string equal example wrong in doc
Closed / Fixed1615277fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-12-13 21:23:29
The following code appears in the documentation for string, as an example of using string equal:
Test if the string in the variable string is a proper non-empty prefix of the string foobar.
set length [string length $string]
if {$length == 0} {
set isPrefix 0
} else {
set isPrefix [string equal -length $string $string "foobar"]
}
It has an unnoticed bug: the variable after the -length should be $length, not $string.
escargo Ticket [1615277fff]: 1 change
[History diff]2006-12-14 04:24:19
dkf Closed ticket [1615277fff].
[History diff]2006-12-14 21:25:21
Log in (anonymous is fine) to add a comment.