Common Methods for String objects in JavaScript _ javascript skills

Source: Internet
Author: User
This article mainly introduces the common methods of String objects in JavaScript, which is very simple and practical. If you need it, refer to the methods provided by the String object for processing strings and characters.
Common Methods:

CharAt (index): returns the character at index in the string.
IndexOf (searchValue, [fromIndex]): This method searches for the first searchValue in the string. If fromIndex is given, the search starts from the position in the string. When the searchValue is found, the first character of the string is returned.
LastIndexOf (searchValue, [fromIndex]): Search for searchValue from the end of the string and report the first instance found.
Substring (indexA, indexB): obtains the substring from indexA to indexB.
ToLowerCase (): converts all characters in the string to lowercase letters.
ToUpperCaser (): converts all characters in the string to uppercase.

Do you know the usage of the String object? I hope you will like this 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.