String trim

Hello Devcentral,

How i can parse a string in order to obtain only the ten last characters and save them to a variable ?

Thanks in advance,

Best Regards,

M.

something like this may work for you.

set lastTen [string range  [expr [string length ] - 10] end]

http://www.tcl.tk/man/tcl8.4/TclCmd/string.htmM39

something like this may work for you.

set lastTen [string range  [expr [string length ] - 10] end]

http://www.tcl.tk/man/tcl8.4/TclCmd/string.htmM39

I believe range uses index 0, so I updated it to length minus 10.

I believe range uses index 0, so I updated it to length minus 10.