Linux 指令篇:字串处理--expr
AI摘要
由 AI 生成 · 仅供参考
Linux指令篇:字串处理--expr,名称:exprnbsp;###nbsp;字串长度shellgt;gt;nbsp;exprnbsp;lengthnbsp;thisnbsp;isnbsp;anbsp;test14###nbsp;数字商数shellgt;gt;nbsp;exprnbsp;14nbsp;%nbsp;95###nbsp;从位置处抓取字串shellgt;gt;nbsp;exprnbsp;substrnbsp;thisnbsp;isnbsp;anbsp;testnbsp;3nbsp;5
名称:expr
### 字串长度
shell>> expr length "this is a test"
14
### 数字商数
shell>> expr 14 % 9
5
### 从位置处抓取字串
shell>> expr substr "this is a test" 3 5
is is
### 数字串 only the first character
shell>> expr index "testforthegame" e
2
### 字串真实重现
shell>> expr quote thisisatestformela
thisisatestformela
版权声明:本文由驱动中国整理发布,转载需注明出处与原文链接。如有疑问请联系
editor@qudong.com。
本文价值
★★★★★
—
成为第一个评分的人
登录后为本文打分
评论加载中…