参考网络文章,个人工作总结

题记:一般对字符串的操作有以下几种:求长度,截取字符串,拼接字符串,找字符串中某个字符的索引

1 expr 命令

1.1 定义

man 手册

 Print  the  value  of  EXPRESSION to standard output.  A blank line below separates increasing precedence
groups. EXPRESSION may be: ARG1 | ARG2
ARG1 if it is neither null nor , otherwise ARG2 ARG1 & ARG2
ARG1 if neither argument is null or , otherwise ARG1 < ARG2
ARG1 is less than ARG2
。。。等等
跟字符串相关的
match STRING REGEXP
same as STRING : REGEXP substr STRING POS LENGTH
substring of STRING, POS counted from index STRING CHARS
index in STRING where any CHARS is found, or length STRING
length of STRING

1.2示例

[devtac@test_1 ~]$ expr length "how can i just let you walk away"
32

[devtac@test_1 ~]$ expr length "how "
4


[devtac@test_1 ~]$ expr substr "how can i just" 2 6
ow can
[devtac@test_1 ~]$ expr index "how can i how" h
1

 

最新文章

  1. ionic路由传值
  2. poj2631 树的直径
  3. 使用自己的ClassLoader实现热替换
  4. iOS应用架构谈(二):View层的组织和调用方案(上)
  5. sizeof和strlen()的区别
  6. Android 文档之viewAnimator
  7. java的访问控制(包、访问修饰符、修饰符)
  8. 如何识别SQL Server中的CPU瓶颈
  9. WDF驱动的编译、调试、安装
  10. DocKer 创建容器 镜像端口映射失败
  11. Feature Extractor[batch normalization]
  12. MyEclipse 2016 破解详细过程
  13. Bootstrap3基础 pagination 分页按钮 简单示例
  14. [UE4]基于物理的材质
  15. .net core跨平台发布至centos7
  16. 编译安装bluez5.44
  17. ny236 心急的C小加 hdoj1051 Wooden Sticks
  18. 尚未指定报表“Report1”的报表定义
  19. --BEA官方网站(http: //www.bea.com)甲骨文已完成对该公司的收购BEA Weblogic Server 7.0x应用服务器简明安 装、配置手册 1
  20. VirtualBox与Genymotion命令行启动

热门文章

  1. spring3系列一
  2. CentOS系统yum源使用报错:Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge.
  3. pcl曲面网格模型的三种显示方式
  4. 8个排序算法——java
  5. 扩展RadioButtonListFor和CheckBoxListFor
  6. 理解&quot;熵&quot;
  7. StringHelper
  8. System.Environment.CurrentDirectory和Application.StartupPath
  9. python基础补漏-05-生成器和装饰器
  10. 第一次源码分析: 图片加载框架Picasso源码分析