View previous topic :: View next topic |
Author |
Message |
joke Voice
Joined: 19 Aug 2005 Posts: 13 Location: Karlsruhe
|
Posted: Mon Oct 17, 2005 6:48 am Post subject: First x chars of a string variable |
|
|
Hi,
is it possible to create a variable with the first x chars of another string variable?
For example:
string1 -> "Hello world"
string2 -> First 5 chars of string1 -> "Hello"
Thx |
|
Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Mon Oct 17, 2005 6:55 am Post subject: |
|
|
Code: | set string2 [string range $string1 0 4] |
|
|
Back to top |
|
 |
joke Voice
Joined: 19 Aug 2005 Posts: 13 Location: Karlsruhe
|
Posted: Mon Oct 17, 2005 7:04 am Post subject: |
|
|
Thx for the quick and correct answer. Script works fine now.  |
|
Back to top |
|
 |
|