首页 > 系统服务 > 详细

Shell 字符串操作

时间:2019-12-22 16:40:21      阅读:81      评论:0      收藏:0      [点我收藏+]

Shell 字符串操作

赋值

astr="Hello World"
bstr=Hello

substring

echo $astr
echo ${astr:6}
echo ${astr:0:6}

replace

echo ${astr/s1/s2} # ReplaceFirst
echo ${astr//s1/s2} # ReplaceAll

contact

cstr="$astr+$bstr"

Shell 字符串操作

原文:https://www.cnblogs.com/stdpain/p/12080103.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!