当前位置:网站首页>The substring() method in. JS can be used to intercept all characters after the specified string
The substring() method in. JS can be used to intercept all characters after the specified string
2022-06-23 20:33:00 【It workers】
substring(start,stop) Method is used to extract characters that are mediated between two specified subscripts .
notes :1)substring() The returned substrings include start The character at , But does not include stop The character at ,
2)start Is a required parameter ,stop Is an optional parameter
3) When stop and start When equal , Return to empty , If start>stop, The method will exchange these two parameters before extracting the substring
Used to intercept all characters after the specified string :
function getCaption(obj){
var index=obj.lastIndexOf("\-");
obj=obj.substring(index+1,obj.length);
// console.log(obj);
return obj;
}
var str=" Enforcement process - The examination and approval ";
getCaption(str);边栏推荐
- 实现vscode写markdown文档+图片自动上传至腾讯云cos
- Official announcement. Net 7 preview 5
- 5 月最大的 GameFi 崩溃受害者能否在熊市中生存?| May Monthly Report
- JS高级程序设计第 4 版:生成器的学习
- @@Script implementation of ishell automatic deployment
- Real topic of the 13th National Competition of single chip microcomputer in the Blue Bridge Cup
- How to install SSL certificates in Microsoft Exchange 2010
- Development notes of wedding studio applet based on wechat applet
- Importance and purpose of test
- 【Golang】怎么实现Go程序的实时热更新
猜你喜欢

Applet development framework recommendation

LeetCode 260. Number III that appears only once

Rendering of kotlin jetpack compose tab using animatedvisibility

The "open source star picking program" container pulls private images from harbor, which is a necessary skill for cloud native advanced technology

Open source SPL redefines OLAP server

20 provinces and cities announce the road map of the meta universe

Chaos engineering, learn about it

Activity registration | introduction to mongodb 5.0 sequential storage features

Official announcement. Net 7 preview 5

RStudio 1.4软件安装包和安装教程
随机推荐
Emmet语法规范
Tcp/udp Fundamentals
logstash启动 -r 参数
How to avoid the "black swan" incident in the gene field: a security war behind a preventive "recall"
Teach you how to develop desktop applications with web pages
深入理解和把握数字经济的基本特征
How to build Tencent cloud game server? Differences between cloud game platforms and ordinary games
Goldfish rhca memoirs: do447 managing user and team access -- effectively managing users with teams
How to open a domestic futures account? Which futures company is safer to open an account?
GL Studio 5 安装与体验
【Golang】快速复习指南QuickReview(七)——interface
JS高级程序设计第 4 版:生成器的学习
Logstash start -r parameter
Implementation of microblog system based on SSM
实现vscode写markdown文档+图片自动上传至腾讯云cos
[golang] quick review guide quickreview (IV) -- functions
What is the difference between a database and a cloud disk drive? What functions can cloud disk drives achieve?
Check four WiFi encryption standards: WEP, WPA, WPA2 and WPA3
想开个户,在股票网上开户安全吗?资金会被骗走吗?
【Golang】深究字符串——从byte rune string到Unicode与UTF-8