Performs one of several string operations, depending on option. The legal options (which may be abbreviated) are:
string first a 0a23456789abcdef 5
string first a 0123456789abcdef 11
In the specifications above, the integer value M contains no trailing whitespace and the integer value N contains no leading whitespace.
If charIndex is less than 0 or greater than or equal to the length of the string then this command returns an empty string.
In the case of boolean, true and false, if the function will return 0, then the varname will always be set to 0, due to the varied nature of a valid boolean value.
string last a 0a23456789abcdef 15
string last a 0a23456789abcdef 9
string map {abc 1 ab 2 a 3 1 0} 1abcaababcabababc
Note that if an earlier key is a prefix of a later one, it will completely mask the later one. So if the previous example is reordered like this,
string map {1 0 ab 2 a 3 abc 1} 1abcaababcabababc
set length [string length $string] if {$length == 0} { set isPrefix 0 } else { set isPrefix [string equal -length $length $string "foobar"] }