用户工具

站点工具


Command disabled: resendpwd
tcl:split

TCL split 多个字符为分隔符

TCL里默认的split函数是以单个字符为分隔符对字符串进行分割,下面的程序实现了用多个字符的字符串对目标字符串进行split:

proc wsplit {str sep} {
  split [string map [list $sep \0] $str] \0
} 

TCL以多个空格符分割

split [regsub -all {\s+} "a    b" " "]
tcl/split.txt · 最后更改: 2013/06/07 14:09 (外部编辑)