文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>《TCL 教程英文版》 笔记 §19 字符串子命令 - l..

《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

相关阅读 更多 +
排行榜 更多 +
球我归位手机版

球我归位手机版

休闲益智 下载
布娃娃劈砍免费版

布娃娃劈砍免费版

休闲益智 下载
进击小巨人最新版

进击小巨人最新版

冒险解谜 下载