JavaScript String Properties and methods

Source: Internet
Author: User
Tags locale

String properties:

Constructor: Returns the function that created the string attribute;

Length: Returns the lengths of the strings;

Prototype: Allows you to add properties and methods to an object;

String properties:

CharAt (): Returns the character at the specified index position;

charCodeAt (): Returns the Unicode value of the specified index position character;

Concat (): Concatenate two or more strings, returning the concatenated string;

fromCharCode (): Converts a character to a Unicode value;

IndexOf (): Returns the position of the first occurrence of the specified character in a string;

LastIndexOf (): Returns the position of the last occurrence of the specified character in the string;

Localecompare (): Compares two strings in a local-specific order;

Match (): Find the match of one or more regular expressions;

Replace (): Replaces a substring that matches a regular expression;

Search (): Retrieves the value that matches the regular expression;

Slice (): Extracts a fragment of a string and returns the extracted part in a new string;

Split (): Splits a string into a substring array;

SUBSTR (): Extracts the specified number of characters from the starting index number in the string;

SUBSTRING (): Extracts the characters between two specified index numbers in a string;

toLocaleLowerCase (): Converts a string to lowercase based on the host's locale, with only a few languages (such as Turkish) with a local case-specific mapping;

toLocaleUpperCase (): Converts a string to uppercase based on the host's locale, with only a few languages (such as Turkish) with a local case-specific mapping;

toLowerCase (): Converts the string to lowercase;

ToString (): Returns the value of the string object;

toUpperCase (): Converts the string to uppercase;

Trim (): Remove the string from the end of the white space;

ValueOf (): Returns the original value of a string object;

  

JavaScript String Properties and methods

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.