Str= ' I am a string of strings '
CharAt ()//Get a whole string of strings one of which is a substring
Value range: 0~ string Length-1
Alert (Str.charat ())//I do not write anything in parentheses when the default is No. 0
Alert (Str.charat (4))//character
Alert (Str.sharat (10))//empty parentheses have a value beyond the length of the string and nothing can be played out
Alert (Str.sharat (-2))//null above the legal length of the string, nothing can be played out
---------------------------
Sharcodeat ()//Get character corresponding Unicode encoding 0~9 48~57/a~z 65~90/a~z 97~122
Value range: 0~ string Length-1
Alert (Str.sharcodeat ())//25105 ' I ' in the Unicode code brackets and the default is NO. 0
Alert (Str.sharcodeat ()) Alert (Str.sharcodeat (-5))//null
---------------------------
String.fromCharCode ()//return the corresponding string according to character set encoding
Alert (String.fromCharCode (25105))//' I '
Alert (String.fromCharCode (25105,26153))//' I am '
Alert (String.fromCharCode (25105,26153). Length)//2
---------------------------
IndexOf ()//To find the corresponding subscript from left to right according to the substring of the string
Alert (Str.indexof (' one '))//2 characters number the sub-character ' one ' in STR is 2
Alert (Str.indexof (' string ', 4))//6 The second parameter is determined from the beginning of the first search, starting from the fourth ' word ' to find the ' string ' subscript is 6
Alert (Str.indexof (' String ',-5))//3 when the second value is negative, the default is to start with the No. 0 one.
Alert (Str.indexof (' A string '))//2 ' A string ' as a unit, their first occurrence of the position of the subscript is 2
Alert (Str.indexof (' Me ', 20))//-1 exceeds string length, returns-1
Alert (str.indexof (' min '))//-1 characters not present, not found
---------------------------
LastIndexOf ()//based on the sub-characters of the string find the corresponding subscript from right to left to find
Alert (Str.lastindexof (' I '))//0
Alert (Str.laseindexof (' string '))//6
Alert (str.last.IndexOf (' string ', 5))//3 starting from the 5th position from right to left
JavaScript string method