- string reverse string
Implemented in the Changes in Tcl/Tk 8.5, as part of TIP #272[1].Workaround substitute for 8.4:
Implementation notesThis command converts its argument to the "unicode" object type so that it doesn't have to use Tcl_UtfPrev() masses of times.
proc string'reverse str {
set res {}
set i [string length $str]
while {$i > 0} {append res [string index $str [incr i -1]]}
set res
} ;# RS
% string'reverse "hello, world"
dlrow ,ollehImplementation notesThis command converts its argument to the "unicode" object type so that it doesn't have to use Tcl_UtfPrev() masses of times.
