On 09/19/2016 06:36 PM, Lew Pitcher wrote:
>
> Because both were found in the $blah set of characters
>
> According to the TCL documentation page
>
https://www.tcl.tk/man/tcl8.4/TclCmd/string.htm#M46
>
> string trimleft string ?chars?
> Returns a value equal to string except that any leading characters present
> in the string given by chars are removed.
>
> The ?chars? parameter is a list of characters that may be removed from the
> left hand side of the string, stopping at the first character in the string
> that does not match any character in the ?chars? list.
>
> In your example
> set foo /usr/home/hanzer/LCARS/Entertainment/Star_Trek/TOS/S01
> set blah /usr/home/hanzer/LCARS/Entertainment/Star_Trek
> string trimleft $foo $blah
> the left hand side of $foo, from the first / to the /T of "/TOS" match
> characters in the set given by $blah. So, the trimleft removes them. The
> first "O" in $foo does not match any character in $blah which terminates the
> trim function. This leaves (from $foo) OS/S01 untrimmed.
>