js字符串截取(获取指定字符后面的所有字符内容)
function getCaption(obj, text){
let index = obj.lastIndexOf(text) + text.length-1;
obj = obj.substring(index+1,obj.length);
return obj;
}
let str=" 执法办案流程-立案审批";
getCaption(str,'-');
js字符串截取(获取指定字符后面的所有字符内容)的更多相关文章
- Qt 字符串截取 获取指定字符位置
获取字符在字符串中的位置 QString str = "AT+LOC+LOCATION: 115.850441,33.004833"; QString s = "LOC& ...
- JS字符串截取 “指定字符” 前面和后面的内容!
JS字符串截取 “指定字符” 前面和后面的内容! var string= "07/12" var before = string.split('/')[0] var after = ...
- Wpf 获取指定字体和大小的字符的长宽
Wpf 获取指定字体和大小的字符的长宽 运行环境:Win10 x64, NetFrameWork 4.8, 作者:乌龙哈里,日期:2019-05-09 参考: 章节: 比如一个 Consolas 字体 ...
- js 字符串截取函数substr,substring,slice之间的差异
js 字符串的截取,主要有三个函数,一般使用三个函数:substr,substring,slice. 而这三个函数是不完全一样的,平时很难记住,在这里做下笔记,下次遇到的时候,直接从这里参考,调用合适 ...
- js字符串截取为数组
var str="hello,word,java,eclipse,jsp"; //字符串截取为数组 var strArr=str.split(","); for ...
- JS字符串截取(获取指定字符后面的所有字符内容)
function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring(index ...
- JS字符串截取函数slice(),substring(),substr()的区别
在JS中,slice().substring().substr()都有截取字符串的作用,那他们有哪些用法上的区别呢?如果你也有疑惑,这篇文章或许能够帮助到你. 一.substring() substr ...
- js字符串截取函数slice()、substring()、substr()
摘要 在js中字符截取函数有常用的三个slice().substring().substr()了,下面我来给大家介绍slice().substring().substr()函数在字符截取时的一些用法与 ...
- js 字符串截取 substring() 方法、 substr() 方法、slice() 方法、split() 、join();
三种 js 截取字符串的方法: substring() 方法: substr() 方法: slice() 方法: 1.:substring() 方法:string.substring(from, to ...
- JS字符串截取
substr 方法返回一个从指定位置开始的指定长度的子字符串. stringvar.substr(start [, length ]) 参数stringvar 必选项.要提取子字符串的字符串文字或 S ...
随机推荐
- 【Java】取n工作日后的日期(仅排除周六周日)
import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.*; import java. ...
- HIVE-文字提取
regexp_extract(filed,('aaa|bbb|ccc|ddd'),0) 从字段filed中提取含有aaa或bbb或ccc或ddd的string信息
- TCAM and CAM memory usage inside networking devices(转)
TCAM and CAM memory usage inside networking devices Valter Popeskic Equipment and tools, Physical la ...
- linux mint 中文支持
sudo apt-get install localessudo dpkg-reconfigure locales 设置zh_CN.UTF-8
- cnpm 安装不上
以管理员身份运行power shell,输入以下命令: set-ExecutionPolicy RemoteSigned 出现选项之后,输入A,回车,在输入 get-ExecutionPolicy 出 ...
- .net core 序列日志Serilog
Serilog 是一个用于 .NET 应用程序的诊断日志库.它易于设置,具有干净的 API,并且可以在所有最新的 .NET 平台上运行.尽管即使在最简单的应用程序中它也很有用,但 Serilog 对结 ...
- KingbaseES V8R6集群运维案例之---repmgr standby promote应用案例
案例说明: 在容灾环境中,跨区域部署的异地备节点不会自主提升为主节点,在主节点发生故障或者人为需要切换时需要手动执行切换操作.若主节点已经失效,希望将异地备机提升为主节点. $bin/repmgr s ...
- vue ref用法
<div class="myClass" ref="diva"></div> // 给dom节点添加ref this.$refs.div ...
- 【Java学习Day06】注释种类、符号及用法
注释种类 单行注释:只能注释一行文字 多行注释:可以注释一段文字 文档注释:用来生成说明文件 注释符号及用法 单行注释:// //后面写注释 多行注释:/**/ /* 我是注释 我是注释 我是注释 * ...
- [转载] Image Pixels
转载自http://shutha.org/node/789 Image Pixels Pictures that are printed or that are displayed on a di ...