String processing
1. Connection string:
1) connector +:
2) Connection Assignment + =:
3) Connection letter concat ()
2. find sub-string position indexOf()
1) whether a given string exists in the specified string ( first occurrence )
2) Usage str.indexof (SUBSTR);
3) The presence returns a value greater than or equal to 0 ; return -1
3. find the specified position character Chatat (n)
1) search for characters in a specified position in a string
2) Usage str.charat (n);
3) index starting from 0
4. confirm where the substring last appears in the string lastIndexOf()
1) Get the last position of the substring in the string
2) usage var n=str.lastindexof (ARGSTR)
3) The presence returns a value greater than or equal to 0 ; return -1
5. intercept the first substring of a string substring()
1) Gets the first substring of a specified length of a string
2) usage var substr=str.substring (Gegin[,end]);
3) when begin>length-1 , if end>length-1, the interception is an empty string;
4) If the Begin and end values are reasonable and begin>end, begin and End Interchange
5) Difference from substr(start,length)
6. extracting part of a string slice()
1) Extracts a part of the string and returns a new string
2) usage var substr=str.slice (Begin[,end])
3) Difference from substring ( ): when begin>length-1 , the empty string is returned; when begin>end , return empty string
7. splitting a string into a string array split()
1) Divide the string into substrings
2) usage var array=str.split (s);--s as a separator (can be any combination of strings)
JavaScript string processing