|
$expr substr "$variable" startposition length code: PHP 代码:
zhyfly: ~$ x="this is a test" 4.匹配正则表达式之匹配长度 方法: $expr match "$x" "string" code: PHP 代码:
zhyfly: ~$ x="this is a test" 方法: $echo ${variable#startletter*endletter} # #表示掐头,因为键盘上#在$前面,一个表示最小匹配 $echo ${variable##tartletter*endletter} 两个表示最大匹配 $echo ${variable%startletter*endletter} # %表示去尾,因为键盘上%在$后面,一个表示最小匹配 $echo ${variable%%startletter*endletter} 两个表示最大匹配 code: PHP 代码:
zhyfly: ~$ x="this is a test" 更多相关文章
|
推荐文章
精彩文章
|