Home > Web Front-end > JS Tutorial > body text

Native methods of javascript string manipulation_Basic knowledge

WBOY
Release: 2016-05-16 16:25:23
Original
1179 people have browsed it

join([separator]) array elements are combined into strings

toString() represents an array as a string

reverse() array reversal--change the original array itself

valueOf() returns the array value

Copy code The code is as follows:






toUpperCase()--change to uppercase

charAt(index)--points to a certain character

substring(begin,len)--truncate string

Copy code The code is as follows:






Run result:

Copy code The code is as follows:

JAVASCRIPT
3
java

indexOf--determine whether a certain character exists in the string

Copy code The code is as follows:










Do you guys know anything about the native methods of operating strings in JavaScript? In many cases, these native methods can easily achieve the functions we need.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template