曲径通幽论坛

标题: 取字符串中的第 n 个字符 [打印本页]

作者: beyes    时间: 2011-7-19 23:24
标题: 取字符串中的第 n 个字符
[Bash shell] 纯文本查看 复制代码
content=abcdefg
#取第 1 个字符
${content:0:1}
#取第 3 个字符
${content:2:1}

方法参考:http://www.groad.net/bbs/read.php?tid-2329.html




欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2