Home > Web Front-end > JS Tutorial > js string operation method example analysis_javascript skills

js string operation method example analysis_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:00:30
Original
1307 people have browsed it

The examples in this article describe js string operation methods. Share it with everyone for your reference. The details are as follows:

var str="This is my first Script code.";
document.write("原字符串为:"+str+"<br>")
document.write("第五个字符之后的部分:"+str.slice(5,-1)+"<br>");
document.write("第五个字符之后的15个字符:"+str.substr(5,15)+"<br>");
document.write("第五个字符后至第15个字符:"+str.substring(5,15)+"<br>");
Copy after login

I hope this article will be helpful to everyone’s JavaScript programming design.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template