《TCL 教程英文版》 笔记 §19 字符串子命令 - l..
时间:2008-08-26 来源:oychw
§19 字符串子命令 - length index range
实例:
# cat ch19
# !/bin/bash
# \
exec tclsh "$0" "$@"
set string "this is my test string"
puts "There are [string length $string] characters in \"$string\""
puts "[string index $string 1] is the second character in \"$string\""
puts "\"[string range $string 5 10]\" are characters between the 5'th and 10'th"
运行结果:
# ./ch19
There are 22 characters in "this is my test string"
h is the second character in "this is my test string"
"is my " are characters between the 5'th and 10'th
相关阅读 更多 +