Platform Support
| IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|
| 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
String Constructor(String string) : String
Constructs an instance of a String.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||
String(String string) : StringConstructs an instance of a String. Parameters
Returns
|
|||||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|---|
|
constructor : Object
Specifies the function that creates the String prototype.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
|
length : Number
Number of characters in the string.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
prototype : Object
Reference to the String prototype object.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
anchor(String name) : String
Returns a copy of a string as an HTML anchor. (e.g <a name="name">
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
big() : String
Returns a copy of a string surrounded by <big></big> HTML tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | no | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
blink() : String
Returns a copy of a string surrounded by <blink></blink> HTML
tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
bold() : String
Returns a copy of a string surrounded by <bold></bold> HTML
tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
charAt(String index) : String
Returns the specified character from a string.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
charCodeAt(Object index) : Number
Returns the the Unicode value of the character at the specified index.
|
Show Details | 5.5+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
concat(String string2...stringN) : String
Combines the text of two or more strings and returns a new string.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
fixed() : void
Returns a copy of a string surrounded by <tt></tt> tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
fontcolor(String color) : String
Returns a copy of a string surrounded by <font color = "color"></font>
tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
fontsize(Number size) : String
Returns a copy of a string surrounded by <font size="size"></font>
tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
static fromCharCode(String num1, ..., numN) : String
Returns a string created by using the specified sequence of Unicode values.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
indexOf(String searchValue, [String fromIndex]) : Number
Returns the index within the calling String object of the first occurrence
of the specified value, starting the search at fromIndex, or -1 if the
value is not found.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
italics() : String
Returns a copy of a string surrounded by <i></i> tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
lastIndexOf(String searchValue, [String fromIndex]) : Number
Returns the index within the calling String object of the last occurrence
of the specified value, or -1 if not found. The calling string is searched
backward, starting at fromIndex.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
link(String href) : String
Returns a copy of a string surrounded by <a href="href"></a>
tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
localeCompare(String target) : Number
Uses locale-specific ordering to compare two strings.
|
Show Details | 5.5+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
match(Object regexp) : Array
Used to match a regular expression against a string.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
replace(String regexp, String newSubStr, String function) : Array
Finds a match between a regular expression and a string, and replaces the
matched substring with a new substring.
|
Show Details | 3.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
search(String regexp) : Number
Executes the search for a match between a regular expression and this String
object.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
slice(String beginSlice, String endSlice) : String
Extracts a section of a string and returns a new string.
|
Show Details | 4.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
small() : String
Returns a copy of a string surrounded by <small></small> tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
split(String separator, [String limit]) : Array
Splits a String object into an array of strings by separating the string
into substrings.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | no | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
strike() : String
Returns a copy of a string surrounded by tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
sub() : String
Returns a copy of a string surrounded by <sub></sub> tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
substr(Number start, Number length) : String
Returns the characters in a string beginning at the specified location
through the specified number of characters.
|
Show Details | 4.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
substring(Number indexA, [Number indexB]) : String
Returns a subset of a String object.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Parameters
Returns
|
|||||||||||||||||||||||||||||
|
sup() : String
Returns a copy of a string surrounded by <sup></sup> tags.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
toLocaleLowerCase() : String
Returns a copy of a string in lowercase letters in a locale-specific format.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | no | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
toLocaleUpperCase() : String
Returns a copy of a string in uppercase letters in a locale-specific format.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | no | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
toLowerCase() : String
Returns the string value converted to lowercase.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
toString() : String
Returns a string representing the specified object.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
toUpperCase() : String
Returns the string value converted to all uppercase.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
|
valueOf() : Object
Returns the primitive value of a String object.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | |||||||||||||||||||||||
|
Returns
|
|||||||||||||||||||||||||||||
Availability
JavaScript 1.0|JScript 1.0|ECMAScript v1
