String

A character string. Each character is adressable by index.

Methods:

String, anchor, big, blink, bold, charAt, charCodeAt, concat, fixed, fontcolor, fontsize, fromCharCode, indexOf, italics, lastIndexOf, link, localeCompare, match, replace, search, slice, small, split, strike, sub, substr, substring, sup, toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toSource, toString, toUpperCase, valueOf

Objects:

Number

Property Listing

Property

Type

Access

Description

length

Number

readonly

The length of the string.

Method Listing

Constructor

String String (value:Varies)

Returns a string representation of the value given as an argument.

Parameter

Type

Description

value

Varies

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.

Those values are concatenated with the original string, the result is returned. The original string is not effected. Returns the concatenated string.

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.

The string is searched backward, starting at fromIndex. Returns the index within the string where the last occurrence of searchValue was found, or -1 if it was not found.

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:Varies, with:String)

Parameter

Type

Description

what

Varies

 

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.

The substring begins at startSlice, and includes all characters up to, but not including the character at the index endSlice. A negative value indexes from the end of the string. For example, a negative value for startSlice is resolved as: string. length + startSlice. The original string is unchanged. Returns a substring of characters from the given string, starting at startSlice and ending with endSlice-1.

Parameter

Type

Description

startSlice

Number

The index at which to begin extraction.

endSlice

Number

The index at which to end extraction.

If omitted, slice extracts to the end of the string.

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.

The substrings are created by breaking the original string at places that match delimiter, the delimiter characters are removed. Returns an array whose elements are the substrings.

Parameter

Type

Description

delimiter

String

Specifies the string to use for delimiting.

If delimiter is omitted, the array returned contains one element, consisting of the entire string.

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.

The original string is unchanged. Returns a string containing the extracted 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.

The original string is unchanged. Returns a substring of characters from the given string, starting at indexA and ending with indexB-1.

Parameter

Type

Description

indexA

Number

The index to begin extracting.

indexB

Number

(Optional) The index at which to end extraction.

If omitted, slice extracts to the end of the string.

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).

The original string is unchanged.

String toLocaleUpperCase ()

Returns a new string which contains all the characters of the original string converted to uppercase (localized).

The original string is unchanged.

String toLowerCase ()

Returns a new string which contains all the characters of the original string converted to lowercase.

The original string is unchanged.

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.

The original string is unchanged.

String valueOf ()

Returns itself.