String method
Returns the character according to the subscript:
Str.charat ()//pass in a subscript return character
Str.charcodeat ();//pass in a subscript to get the encoding
String.formcharcode ();//Accept the code, encode the turn character
Incoming characters return subscript:
Str.indexof ();//Incoming character returns subscript, multiple characters can be passed in
If the return-1 is the description not found
Str.lastindexof ();
Start from right to left
Intercept and return a string:
Str.substring ();//pass in two subscript, return the intercepted character, if do not pass anything then direct return, if enter and leave negative is directly treated as zero, can handle subscript size to correct adjustment
Str.slice ();//can receive negative numbers, can be backwards from behind the number of forward
Note: Simply return the intercepted content without changing the original string;
Convert to Case:
Str.touppercase ();//Large
Str.tolowercase ();//Small
String segmentation Array
Str.split ("."); Incoming delimiters
Returns an array of string characters in the word ""
If a character is passed in, it is divided into two two array elements directly from this character.
You can also pass in the length of an array more
JS String method