String, Array, and stringarray in javascript
Simply put, string is a character (string )...
Array is an array... it can contain numbers, characters, and a series of stuff !!!
Previous example:
Copy codeThe Code is as follows:
Var str = "liuzhanqi ";
Document. write (str ["length"]); // equivalent to str. l ength
Var str = string. fromcharcode (72,101,108,108,111, 33 );
Document. write (str); // each integer is unicode encoded and connected to a string.
Var str1 = "liu". localecompare ("zhan"); // compare the current string with the parameter string according to the default comparison rules provided by the system
Document. write (str1 );//
Var str2 = "liu". slice (1); // extract a substring from the current string
Document. writeln (str2 );
Document. writeln ("se nki". split (''); // splits the string by a separator and returns an array.
Document. write ('Liu '. fontcolor ('red '));
Document. write ('Liu '. fixed (); // display the string as an equal-width character.
Document. write ('Liu '. strike (); // Add a strikethrough to the string.
Document. write ("senki". sub (); // displays as a subscript
Document. write ("senki". sup (); // displays as superscript
CharCodeAt (index) returns the Unicode encoding of the character at the string index. The value ranges from 0 ~ An integer between 65535. If the index is out of the range, NaN is returned.
Concat (str2) concatenates str2 in the current string to form a new string.
Anchor (anchar_name) creates an anchor
Link (url) with hyperlink
CharAt (index) returns a character at the specified position of the index in the string.
Do you know about String and array Arry in javascript? If you have any questions, please leave me a message and make common progress.