A brief talk on the Array_javascript techniques of strings string and array in JavaScript

Source: Internet
Author: User

The simple point is that string is a character (string) ...
And the array is arrays ... Can put numbers ah, character Ah and a series of Dongdong!!!

Last Example:

Copy Code code as follows:

var str = "Liuzhanqi";
document.write (str["Length"]);//equivalence STR.L ength
var str = String.fromCharCode (72, 101, 108, 108, 111, 33);
document.write (str); The integers are encoded as Unicode and are concatenated into strings.
var str1 = "Liu". Localecompare ("Zhan")//Compare current string with parameter string by default comparison rule provided by this system
document.write (STR1);
var str2 = "Liu". Slice (1);//extract a substring from the current string
Document.writeln (STR2);
Document.writeln ("se nki". Split ("));////split string with delimiter, return an array.
document.write (' Liu '. fontcolor (' red '));
document.write (' Liu '. fixed ());//Make the string appear as a width word
document.write (' Liu '. strike ());//Add a strikethrough to the string
document.write ("Senki". Sub ());//Display as subscript
document.write ("Senki". sup ());//Display as superscript

charCodeAt (index) returns the Unicode encoding of the character at the index of the string, which is an integer between 0~65535 and, if the index is out of range, returns Nan.

Concat (STR2) joins the string str2 the current string into a new string.

Anchor (ANCHAR_NAME) creates an anchor point

Link (URL) plus hyperlink

CharAt (index) returns a character in the string at the specified position in the index

Do the partners understand that string strings and arrays in JavaScript are Arry? Please leave a message for me and we will make progress together.

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.