JavaScript string Object

Source: Internet
Author: User

Tag: AST does not start ring str ASE find replace replacement

Get type

1. Mystring.charat (num)

Returns the character at the specified position.

2. Mystring.charcodeat (num)

that returns the character of the specified position . Unicode encoding , This return value is an integer between 0-65535.

3. String.fromCharCode ()

accept one or more of the specified Unicode value, and then returns one or more strings.

Find type

1. Mystring.indexof ("")

Returns the position of the first occurrence of a specified string in a string

parameter 2 num starts from that position to find

2. Mystring.lastindexof ()

Returns the location of the last occurrence of the specified string value

3. Mystring.match ()

retrieves the specified value in a string, the value returned is the specified ( value )

4. Search ()

Can only be used for regular.

5. Mystring.replace ()

Replace some characters in a string with some other characters

Interception type

1.mystring.slice (Start,end)

from the specified start position to the end position ( not included ) all the strings. If you do not specify an end position, from the specified start position, the slice parameter can be a negative number, or a negative number, starting at 1 , referring to the end of the string.

2.substring (Start,end)

from the specified start position to the end position ( not included ) all the strings. If the end position is not specified, the end is taken from the specified start position

3.substr (Start,length)

Takes a string of the specified length from the specified position. If no length is specified, the end is taken from the specified starting position.

Conversion type

1.split (" split position ", [ specified length ])

To split a string into an array

2.toLowerCase ();

Used to convert a string to lowercase.

3.toUpperCase ();

Convert a string to uppercase

Concat ()

Used to concatenate two or more strings.

JavaScript string Object

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.