JS string manipulation function

Source: Internet
Author: User

Concat () – combines two or more characters of text to return a new string.
IndexOf () – returns the index at the first occurrence of a substring in a string. If there is no match, returns-1.
CharAt () – returns the character at the specified position.
LastIndexOf () – Returns the index of the last occurrence of a substring in a string, or 1 if there is no match.
Match () – checks whether a string matches a regular expression.
SUBSTRING () – Returns a substring of the string. Incoming parameters are the start and end positions.
Replace () – Used to find a string that matches a regular expression, and then use the new string instead of the matching string.
Search () – performs a regular expression matching lookup. If the lookup succeeds, returns the matching index value in the string. otherwise returns-1.
Slice () – Extracts part of a string and returns a new string.
Split () – A string is made into a string array by dividing the string into substrings.
length– returns the length of a string, the length of which is the number of characters it contains.
toLowerCase () – Converts the entire string into lowercase letters.
toUpperCase () – turns the entire string into uppercase.

JS string manipulation function

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.