1 varstr = "Liuzhanqi";2document.write (str["Length"]);//equivalent STR.L ength3 4 varstr = String.fromCharCode (72, 101, 108, 108, 111, 33);5document.write (str);//Each integer is encoded as Unicode and concatenated into a string. 6 7 varstr1 = "Liu". Localecompare ("Zhan");//Compare the current string with the parameter string by default comparison rules provided by the system8document.write (STR1);//9 Ten varstr2 = "Liu". Slice (1);//extracts a substring in the current string One Document.writeln (str2); A -Document.writeln ("se nki". Split ("));//splits a string with a delimiter, returning an array. -document.write (' Liu ' fontcolor (' red '))); thedocument.write (' Liu '. fixed ());//make a string appear as a equal width word -document.write (' Liu '. strike ());//add strikethrough on a string -document.write ("Senki". Sub ());//Display as subscript -document.write ("Senki". sup ());//Display as superscriptView Code
charCodeAt (index) returns the Unicode encoding of the character at index of the string, which is an integer between 0~65535, or Nan If index is out of range.
Concat (STR2) joins the string str2 the current string to form a new string.
Anchor (ANCHAR_NAME) Create an anchor point
Link (URL) plus hyperlink
CharAt (index) returns a character at the specified position of the index in the string
JavaScript---string and arry