常用linux 命令 -字符串相关
2024-10-15 18:30:06
参考网络文章,个人工作总结
题记:一般对字符串的操作有以下几种:求长度,截取字符串,拼接字符串,找字符串中某个字符的索引
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
最新文章
- ionic路由传值
- poj2631 树的直径
- 使用自己的ClassLoader实现热替换
- iOS应用架构谈(二):View层的组织和调用方案(上)
- sizeof和strlen()的区别
- Android 文档之viewAnimator
- java的访问控制(包、访问修饰符、修饰符)
- 如何识别SQL Server中的CPU瓶颈
- WDF驱动的编译、调试、安装
- DocKer 创建容器 镜像端口映射失败
- Feature Extractor[batch normalization]
- MyEclipse 2016 破解详细过程
- Bootstrap3基础 pagination 分页按钮 简单示例
- [UE4]基于物理的材质
- .net core跨平台发布至centos7
- 编译安装bluez5.44
- ny236 心急的C小加 hdoj1051 Wooden Sticks
- 尚未指定报表“Report1”的报表定义
- --BEA官方网站(http: //www.bea.com)甲骨文已完成对该公司的收购BEA Weblogic Server 7.0x应用服务器简明安 装、配置手册 1
- VirtualBox与Genymotion命令行启动
热门文章
- spring3系列一
- CentOS系统yum源使用报错:Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge.
- pcl曲面网格模型的三种显示方式
- 8个排序算法——java
- 扩展RadioButtonListFor和CheckBoxListFor
- 理解";熵";
- StringHelper
- System.Environment.CurrentDirectory和Application.StartupPath
- python基础补漏-05-生成器和装饰器
- 第一次源码分析: 图片加载框架Picasso源码分析