首页 > 系统 > Linux > 正文

Linux 指令篇:字串处理--expr

2024-07-26 00:31:14
字体:
来源:转载
供稿:网友
名称: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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表