(redirected from Main.ChompingTheEndsOffOfBracedStrings)
I noticed that when there is nothing passed in an args paramter (a catch-all parameter that sucks up the rest of the parameters in a proc call), it contains the string "{}". This is an actual string, not a braced expression. To get rid of those, and to be able to treat args as a regular string, the following seems to work:
[string range $args 1 [expr {[string length $args]-2}]]
This removes the first character and last character from the string (strings are basically zero-based).
| Tags: | Categories: Articles |
Recent Changes |
Printable View |
Page History |
Edit Page
Page last modified on April 09, 2012, at 09:27 AM by tamara