What are the javascript string methods?

青灯夜游
Release: 2023-01-06 11:13:57
Original
3220 people have browsed it

Javascript string methods: charAt(), concat(), fixed(), fontcolor(), fontsize(), indexOf(), italics(), link(), match(), replace() , search(), etc.

What are the javascript string methods?

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

String method in javascript

##MethodDescriptionanchor()Create HTML anchor. big()Display the string in large font. blink()Display the flashing string. bold() Use bold to display strings. charAt()Returns the character at the specified position. charCodeAt()Returns the Unicode encoding of the character at the specified position. concat()Connection string. fixed()Displays a string in typewriter text. fontcolor()Use the specified color to display the string. fontsize()Use the specified size to display the string. fromCharCode()Creates a string from a character encoding. indexOf()Retrieve string. italics() Use italics to display strings. lastIndexOf()Search the string from back to front. #link()Display a string as a link. localeCompare()Compares two strings in locale-specific order. match()Find a match for one or more regular expressions. replace()Replace the substring matching the regular expression. search()Retrieve values ​​that match a regular expression. slice()Extracts a fragment of a string and returns the extracted part in a new string. small()Use small font size to display strings. split()Split the string into a string array. strike() Use strikethrough to display a string. sub()Display the string as a subscript. substr()Extracts the specified number of characters from the string from the starting index number. substring()Extract the characters between two specified index numbers in the string. sup()Display the string as superscript. toLocaleLowerCase()Convert the string to lowercase. toLocaleUpperCase()Convert the string to uppercase. toLowerCase()Convert the string to lowercase. toUpperCase()Convert the string to uppercase. toSource()Represents the source code of the object. toString() Returns a string. valueOf()Returns the original value of a string object.

String attributes in javascript

AttributesDescriptionconstructorA reference to the function that created the object length characters The length of the stringprototypeAllows you to add properties and methods to the object
[Recommended learning:

javascript advanced tutorial

The above is the detailed content of What are the javascript string methods?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template