String, Array, and stringarray in javascript

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.