| View previous topic :: View next topic |
| Author |
Message |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Thu Mar 23, 2006 4:48 am Post subject: Changing something toupper? |
|
|
How can I change second toupper before i write/echo/whatever to file/chan when using this?
| Code: | | foreach {first second} [split $arg] {break} | or | Code: | set first [lindex [split $arg] 1]
set second [lindex [split $arg] 2] |
(I belive the first one is faster code than the last one, correct?) |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Mar 23, 2006 1:39 pm Post subject: |
|
|
To convert second to topupper
| Code: | | set second [string toupper $second] |
And
| Code: | set first [lindex [split $arg] 1]
set second [lindex [split $arg] 2] |
is different than
| Code: | | foreach {first second} [split $arg] {break} |
since the 2nd code takes the first and second words while the 1st takes the second and the third words. You need to start with index 0, so first is [lindex [split $arg] 0] and second is [lindex [split $arg] 1]. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|