String operation method (everyone has what do not understand can come to me ah, but this article is a bit not so tall still, everyone do not mind OH)

Source: Internet
Author: User

String. CharAt (Index): Returns the character at the specified position in the preceding string

String. charCodeAt (Index): the encoding (Unicode) of the character that returns the position specified in the preceding string

String.fromCharCode (encoded value): Convert the encoded value to the corresponding character

String. substring (start, end): Returns the string from the start position to the end position in the preceding original string, without the character of the end position

String. Slice (start, end): Returns the string from the start position to the end position in the preceding original string, without the character of the end position

String. indexOf (char, start): Returns the position of the first occurrence of the specified character in the preceding string
Char: the character to find
Start: The starting position of the lookup

String. LastIndex (char, start): Returns the position of the first occurrence of the specified character in the trailing string

String. Search (): Finds and returns the location where the string appears, not found-1

String. Trim (): Remove string trailing spaces

String. toUpperCase (): Turn uppercase
String. toLowerCase (): Turn lowercase

The string. Split (): Splits the string into multiple characters by the specified delimiter and saves them in the array.
return value: Array

String operation method (everyone has what do not understand can come to me ah, but this article is a bit not so tall still, everyone do not mind OH)

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.