I have a word "example" and I wanna get 2 chars from the beginning so it would be "ex" or two fom the end so it would be "le" how can I do it in TCL?
Thanks in advance for help

Code: Select all
[string range $string 3 4] == $another_string
Code: Select all
set first_two [string range $string first 1]
Code: Select all
set last_two [string range $string last-1 last]