JS Program Base String specific

Source: Internet
Author: User

1. CharAt () write a number in the general browser equivalent to square brackets but because of the existence of IE6, he has a purpose. Because IE6 is not compatible with square brackets

2. charCodeAt () and Charat almost identical just out of the ASCII code can also be converted to Chinese

3. fromCharCode () and the above is just the opposite of the use of a decimal number to be able to convert the encoding to the corresponding character does not need to instantiate the object can be used

4. Insizeof () write a character in brackets or a few find the first occurrence of the character, assuming no return-1

5. LastindexOf from the back and forward.

6. Search is in the form of a regular way of searching. Other and IndexOf

7. Replace () has two parameters the first parameter is the one that should be replaced by the second number of parameters

8. Slice () has two start and end positions. But don't take the last.

Assuming that the last position is not always taken to the final end

The difference between slice and substring is assumed to be negative, substring will become 0 and slice will start from behind.

9. Differences between substring and substr substr Two participants take the last position

Split () A thing with this thing as a separator line as an array


toLowerCase all become lowercase touppercase are capitalized

JS Program Base String specific

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.