String
QuickLinks
Properties
Property | Type | Access | Description |
---|---|---|---|
length | number | readonly | The length of the string. |
Methods
String String (value:any)
Returns a string representation of the value given as an argument.
Parameter | Type | Description |
---|---|---|
value | any | A number, variable, or object to convert to a string. |
string anchor (name:string)
Returns a string consisting of this string enclosed in a <a> tag.
Parameter | Type | Description |
---|---|---|
name | string | The text to be stored in the anchors' name attribute. |
string big ()
Returns a string consisting of this string enclosed in a <big> tag.
string blink ()
Returns a string consisting of this string enclosed in a <blink> tag.
string bold ()
Returns a string consisting of this string enclosed in a <b> tag.
string charAt (index:number)
Returns the character at the specified index.
Parameter | Type | Description |
---|---|---|
index | number | An integer between 0 and string.length -1, specifying the character to return. |
number charCodeAt (index:number)
Returns the Unicode value of the character at the given index.
Parameter | Type | Description |
---|---|---|
index | number | An integer between 0 and string.length -1, specifying the character. |
string concat (value:string)
If necessary, converts the one or more given values to strings.
Parameter | Type | Description |
---|---|---|
value | string | The values to be concatenated with the given string. |
string fixed ()
Returns a string consisting of this string enclosed in a <tt> tag.
string fontcolor (color:string)
Returns a string consisting of this string enclosed in a <font> tag.
Parameter | Type | Description |
---|---|---|
color | string | The value to be stored in the tag's color attribute. |
string fontsize (size:number)
Returns a string consisting of this string enclosed in a <font> tag.
Parameter | Type | Description |
---|---|---|
size | number | The value to be stored in the tag's size attribute. |
String fromCharCode (value1:number)
Returns a string created by concatenation one or more characters specified as ASCII values.
Parameter | Type | Description |
---|---|---|
value1 | number | One or more ASCII values. |
number indexOf (searchValue:string, offset:number)
Returns the index within the string of the first occurrence of the specified string, starting the search at fromIndex if provided.
Parameter | Type | Description |
---|---|---|
searchValue | string | The string for which to search. |
offset | number | The starting offset of the search. |
string italics ()
Returns a string consisting of this string enclosed in a <i> tag.
number lastIndexOf (searchValue:string, offset:number)
Returns the index within the string of the last occurrence of the specified value.
Parameter | Type | Description |
---|---|---|
searchValue | string | The string for which to search. |
offset | number | The starting offset of the search. |
string link (href:string)
Returns a string consisting of this string enclosed in a <a> tag.
Parameter | Type | Description |
---|---|---|
href | string | The value to be stored in the tag's href attribute. |
number localeCompare (what:string)
Performs a localized comparison of two strings.
Parameter | Type | Description |
---|---|---|
what | string | The string to compare with. |
Array match (regexp:RegExp)
Matches a string against a regular expression.
Parameter | Type | Description |
---|---|---|
regexp | RegExp | The regular expression to use. |
string replace (what:any, with:string)
Parameter | Type | Description |
---|---|---|
what | any | |
with | string |
number search (search:RegExp)
Parameter | Type | Description |
---|---|---|
search | RegExp |
string slice (startSlice:number, endSlice:number)
Extracts a substring of the given string and returns it as a new string.
Parameter | Type | Description |
---|---|---|
startSlice | number | The index at which to begin extraction. |
endSlice | number | The index at which to end extraction. |
string small ()
Returns a string consisting of this string enclosed in a <small> tag.
string split (delimiter:string, limit:number)
Splits a string into a group of substrings, places those strings in an array, and returns the array.
Parameter | Type | Description |
---|---|---|
delimiter | string | Specifies the string to use for delimiting. |
limit | number |
string strike ()
Returns a string consisting of this string enclosed in a <strike> tag.
string sub ()
Returns a string consisting of this string enclosed in a <sub> tag.
string substr (start:number, length:number)
Returns a string containing the characters beginning at the specified index, start, through the specified number of characters.
Parameter | Type | Description |
---|---|---|
start | number | Location at which to begin extracting characters. |
length | number | (OptIonal) The number of characters to extract. |
string substring (indexA:number [, indexB:number])
Returns a substring of the given string by extracting characters from indexA up to but not including indexB.
Parameter | Type | Description |
---|---|---|
indexA | number | The index to begin extracting. |
indexB | number | (Optional) The index at which to end extraction. |
string sup ()
Returns a string consisting of this string enclosed in a <sup> tag.
string toLocaleLowerCase ()
Returns a new string which contains all the characters of the original string converted to lowercase (localized).
string toLocaleUpperCase ()
Returns a new string which contains all the characters of the original string converted to uppercase (localized).
string toLowerCase ()
Returns a new string which contains all the characters of the original string converted to lowercase.
string toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with built-in classes.
string toString ()
Returns itself.
string toUpperCase ()
Returns a new string which contains all the characters of the original string converted to uppercase.
Return
String String.String (value:any)
String String.fromCharCode (value1:number)