Javascript string functions

Source: Internet
Author: User

Javascript string functions

(1)AnchorFunction: generate an anchor for superlinking. The anchor function sets the name of the <ANAME...> link point, and the link function sets the URL address of <a href =...>.

(2)BigFunction: add the font to "1" and the result is the same as that of the <BIG>... </BIG> label.

(3)BlinkFunction: causes the string to flash. The result is the same as that of the <BLINK>... </BLINK> label.

(4)BoldFunction: bold the font, which is the same as the result of the <B>... </B> label.

(5)CharAtFunction: returns a specified character in a string.

(6)FixedFunction: Set the font to a fixed-width font, which is the same as the result of the <TT>... </TT> label.

(7)FontcolorFunction: Set the font color. The result is the same as that of the <FONTCOLOR = color> label.

(8)FontsizeFunction: Set the font size. The result is the same as that of the <FONTSIZE = n> label.

(9)IndexOfFunction: returns the index of the first subscript found in the string, starting from the left.

(10)ItalicsFunction: Make the font italic, which is the same as the result of the <I>... </I> label.

(11)LastIndexOfFunction: returns the index of the first subscript found in the string, starting from the right.

(12)LengthFunction: returns the length of a string. (No parentheses are required)

(13)LinkFunction: generate a hyperlink, which is equivalent to setting the URL of <AHREF =...>.

(14)SmallFunction: reduce the font by one, which is the same as the result of the <SMALL>... </SMALL> label.

(15)StrikeFunction: adds a horizontal line between the text and returns the same result as the <STRIKE>... </STRIKE> label.

(16)SubFunction: displays a string as a subscript ).

(17)SubstringFunction: returns the specified characters in the string.

(18)SupFunction: displays the string as superscript ).

(19)ToLowerCaseFunction: converts a string to lowercase.

(20)ToUpperCaseFunction: converts a string to uppercase.

(21)MatchReturns an array containing the search results.

var str = "Helloworld!";document.writeln(str.match("world"));document.writeln(str.match("World"));

Result:

World

Null

(22)SearchReturns the position of the first matched string in the entire searched string.

var str = "Helloworld!";document.writeln(str.search(/world/));

Result:

6

(23)Replace(Regexp/substr, replacement) function, replace the matched substring with the specified string, and return the new string.

(24)Split([Separator] [, limit]) function, which separates strings by specified delimiters, adds length restrictions, and returns the split substring array.


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.