|
From: Andreas K. <and...@ac...> - 2009-10-07 16:23:17
|
Tom Jackson wrote:
> We have [string trim], maybe something like [string normalize
> (whitespace)]. The result would be a string where adjacent internal
> whitespace chars are collapsed into one space char, and before and
> after whitespace is eliminated. Then the problem would be solved like
> this:
>
> set mylist [split [string normalize $mystring]]
Oh, you mean
proc string-normalize {str} {
return [regsub -all {\s+} $str { }]
}
--
Sincerely,
Andreas Kupries <an...@ac...>
Developer @ <http://www.activestate.com/>
|