Re: beginner question
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: beginner question

From: Bruce Hartweg <bruce-news@hartweg.us>
Date: Thu Mar 02 2006 - 18:29:30 CET

suchenwi wrote:
>>>From the string map page:
> string trim string ?chars?
> Returns a value equal to string except that any leading or trailing
> characters from the set given by chars are removed. If chars is not
> specified then white space is removed (spaces, tabs, newlines, and
> carriage returns).
> % string trim $str abc
> abc def 123
> means: remove all leading and trailing instances of "a","b", or "c".
> As there are none (the first and last char are spaces), nothing is
> done.
> Just add space to the trim "set":
> % string trim $str "abc "
> def 123
>

and remember what Richard said - it removes any character in the set,
not an expolicit string so "b ca" would work the same, and
the string trim of
  "aaababbbcabbcababcabcabcbacbabcabcbac def 123 bbbbbcacbcab"

would also give you "def 123"

Bruce
Received on Sun Apr 30 02:20:56 2006