String
1 string immutable, if you assign a value to an index of a string, there will be no error, but no effect
Such as:
var s = ' Text ';
S[0] = ' X; '
alert (s); S is still ' Text '
2JavaScript provides some common methods for strings, note that the calling method itself does not alter the contents of the original string, but instead returns a new string.
2.1 toUpperCase The letters in the string into full capitalization
2.2 toLowerCase The letters in the string into full lowercase
2.3 IndexOf index Specifies where the string appears, such as var s = ' Text ' s.indexof (' e ')//1
2.4 substring returns the substring between the specified index area such as: var s = ' Text ' var a = s.substring (1,3)//ex, the first parameter must be positive, the second parameter does not have to, if not, then from the first parameter to the last, the value of opening and closing.
Array and string method differences