charAt(index
:
Number)
:
String
Returns a string containing the character at position index.
charCodeAt(index
:
Number)
:
Number
Returns a number representing the code point value of the character at position index.
concat(strings
:
String...)
:
String
Returns a new String created by concatenating the string arguments together.
equals(obj
:
Object)
:
boolean
Returns true if this string is equal to the string representation of the passed objects.
equalsIgnoreCase(obj
:
Object)
:
boolean
Returns true if this string is equal to the string representation of the passed objects.
indexOf(substring
:
String, start
:
Number)
:
Number
Returns the index of substring in this String object using the specified start value as the location to begin searching.
lastIndexOf(substring
:
String, start
:
Number)
:
Number
Returns the last index of substring in this String object, using the specified start position as the location from which to begin the search.
localeCompare(other
:
String)
:
Number
Returns a number indicating whether the current String sorts before, the same as, or after the parameter other, based on browser and system-dependent string localization.
match(regexp
:
RegExp)
:
String[]
Returns an array of strings that match the regular expression regexp.
replace(regexp
:
RegExp, replacement
:
String)
:
String
Returns a new String that results when matches of the regexp parameter are replaced by the replacement parameter.
replace(regexp
:
RegExp, function
:
Function)
:
String
Returns a new String that results when matches of the regexp parameter are replaced by using the specified function.
replace(literal
:
String, replacement
:
String)
:
String
Returns a new String that results when matches of the literal parameter are replaced by the replacement parameter.
replace(literal
:
String, replacement
:
String, flags
:
String)
:
String
Returns a new String that results when matches of the literal parameter are replaced by the replacement parameter.
replace(literal
:
String, function
:
Function)
:
String
Returns a new String that results when matches of the literal parameter are replaced by using the specified function.
replace(literal
:
String, function
:
Function, flags
:
String)
:
String
Returns a new String that results when matches of the literal parameter are replaced by using the specified function.
search(regexp
:
RegExp)
:
Number
Searches for a match between the passed regular expression and this string and returns the zero-based index of the match, or -1 if no match is found.
slice(start
:
Number, end
:
Number)
:
String
Returns a substring of the current String where the specified start and end locations are used to delimit the String.
split(delimiter
:
String)
:
String[]
Returns an array of String instances created by splitting the current String based on the delimiter.
split(regexp
:
RegExp)
:
String[]
Returns an array of String instances created by splitting the current String based on the regular expression.
split(delimiter
:
String, limit
:
Number)
:
String[]
Returns an array of String instances created by splitting the current String based on the delimiter and limited in size by the limit parameter.
split(regexp
:
RegExp, limit
:
Number)
:
String[]
Returns an array of String instances created by splitting the current String based on the regular expression and limited in size by the limit parameter.
substr(start
:
Number)
:
String
Creates and returns a new String by splitting the current string at the specified start location until the end of the String.
substr(start
:
Number, length
:
Number)
:
String
Creates and returns a new String by splitting the current string at the specified start location and limited by the length value.
substring(from
:
Number)
:
String
Creates and returns a new String by splitting the current string at the specified from location until the end of the String.
substring(from
:
Number, to
:
Number)
:
String
Creates and returns a new String by splitting the current string at the specified from location until the specified to location.
toLowerCase()
:
String
Returns a copy of the current string in all lower-case letters.
toUpperCase()
:
String
Returns a copy of the current string in all upper-case letters.
charAt
Returns a string containing the character at position index.
You should use this method instead
of substring when you need only a single character.
Parameters:
index
-
the index at which the character string is located.
Returns:
a string containing the character at position index.
charCodeAt
Returns a number representing the code point value of the
character at position index. The returned value is a non-negative
integer less than 216 of if there is no character at that position,
the result is NaN.
Parameters:
index
-
the index in the string from which to produce the character code.
Returns:
a non-negative integer less than 216 or NaN.
concat
Returns a new String created by concatenating the string arguments together.
Parameters:
strings
-
zero, one, or more String arguments
Returns:
a new String created by concatenating the string arguments together.
equals
equals(obj
:
Object)
:
boolean
Returns true if this string is equal to the string representation of the
passed objects.
Parameters:
obj
-
another object, typically another string
equalsIgnoreCase
equalsIgnoreCase(obj
:
Object)
:
boolean
Returns true if this string is equal to the string representation of the
passed objects. The comparison is done case insensitive.
Parameters:
obj
-
another object, typically another string
fromCharCode
Returns a new String from one or more characters with Unicode values.
Parameters:
c
-
zero, one, or more character arguments.
indexOf
Returns the index of substring in this String object.
If there is no match, -1 is returned.
Parameters:
substring
-
the String to search for in this String.
Returns:
the index of substring or -1.
indexOf
Returns the index of substring in this String object using
the specified start value as the location to begin searching.
If there is no match, -1 is returned.
Parameters:
substring
-
the String to search for in this String.
start
-
the location in the String from which to begin the search.
Returns:
the index of substring or -1.
lastIndexOf
Returns the last index of substring in this String object.
If there is no match, -1 is returned.
Parameters:
substring
-
the String to search for in this String.
Returns:
the last index of substring or -1.
lastIndexOf
Returns the last index of substring in this String object,
using the specified start position as the location from which
to begin the search.
If there is no match, -1 is returned.
Parameters:
substring
-
the String to search for in this String.
start
-
the location from which to begin the search.
Returns:
the last index of substring or -1.
localeCompare
Returns a number indicating whether the current String sorts before, the same as,
or after the parameter other, based on browser and system-dependent
string localization.
Parameters:
other
-
the String to compare against this String.
Returns:
a number indicating whether the current String sorts before, the same as, or after the parameter other.
match
Returns an array of strings that match the regular expression
regexp.
Parameters:
regexp
-
the regular expression to use.
Returns:
an array of strings that match the regular expression.
replace
Returns a new String that results when matches of the regexp
parameter are replaced by the replacement parameter. The
original String is not modified so you must capture the new String
in a variable to preserve changes. If regexp has the global flag set,
all occurrences are replaced, if the global flag is not set only the
first occurrence is replaced.
Parameters:
regexp
-
the regular expression to use.
replacement
-
a String that is to take the place of all matches of regexp in the current String.
Returns:
a new String that results when matches of the regexp parameter are replaced by the replacement.
replace
Returns a new String that results when matches of the regexp
parameter are replaced by using the specified function. The
original String is not modified so you must capture the new String
in a variable to preserve changes. When you specify a function as the
second parameter, the function is invoked after the match has been performed.
Parameters:
regexp
-
the regular expression to use.
function
-
a Function that operates on matches of regexp in the current String.
Returns:
a new String that results when matches of the regexp parameter are replaced by the function.
replace
Returns a new String that results when matches of the literal
parameter are replaced by the replacement parameter. The
original String is not modified so you must capture the new String
in a variable to preserve changes. This method only replaces the first
occurrence of the literal. To replace all occurrences see the polymorphic
method with a regular expression as argument.
Parameters:
literal
-
the literal string to locate.
replacement
-
a String that is to take the place of all matches of regexp in the current String.
Returns:
a new String that results when the first match of the literal parameter is replaced by the replacement parameter.
replace
Returns a new String that results when matches of the literal
parameter are replaced by the replacement parameter. The
original String is not modified so you must capture the new String
in a variable to preserve changes. This method only replaces the first
occurrence of the literal. To replace all occurrences see the polymorphic
method with a regular expression as argument. Note that if flags
Parameters:
literal
-
the literal string to locate.
replacement
-
a String that is to take the place of all matches of regexp in the current String.
flags
-
a String containing any combination of the Regular Expression flags of g - global match, i - ignore case, m - match over multiple lines.
Returns:
a new String that results when the first match of the literal parameter is replaced by the replacement parameter.
replace
Returns a new String that results when matches of the literal
parameter are replaced by using the specified function. The
original String is not modified so you must capture the new String
in a variable to preserve changes. When you specify a function as the
second parameter, the function is invoked after the match has been
performed.
Parameters:
literal
-
the literal string to locate.
function
-
a Function that operates on the match of literal in the current String.
Returns:
a new String that results when the first match of the literal parameter is replaced by the specified function.
replace
Returns a new String that results when matches of the literal
parameter are replaced by using the specified function. The
original String is not modified so you must capture the new String
in a variable to preserve changes. When you specify a function as the
second parameter, the function is invoked after the match has been
performed.
Parameters:
literal
-
the literal string to locate.
function
-
a Function that operates on the match of literal in the current String.
flags
-
a String containing any combination of the Regular Expression flags of g - global match, i - ignore case, m - match over multiple lines.
Returns:
a new String that results when the first match of the literal parameter is replaced by the specified function.
search
Searches for a match between the passed regular expression and this
string and returns the zero-based index of the match, or -1 if no match
is found.
Parameters:
regexp
-
the regular expression to use.
Returns:
the zero-based indexed value of the first character in the current string that matches the pattern of the regular expression regexp, or -1 if no match is found.
slice
Returns a substring of the current String where the
specified start and end locations are used
to delimit the String.
Parameters:
start
-
the start position in the current String from which the slice will begin.
end
-
the end position in the current String from which the slice will terminate.
Returns:
the String between the start and end positions.
split
Returns an array of String instances created by splitting the current
String based on the delimiter.
Parameters:
delimiter
-
the delimiter to use to split the string.
Returns:
an array of String instances created by splitting the current String based on the delimiter.
split
Returns an array of String instances created by splitting the current
String based on the regular expression.
Parameters:
regexp
-
the regular expression to use to split the string.
Returns:
an array of String instances created by splitting the current String based on the regular expression.
split
Returns an array of String instances created by splitting the current
String based on the delimiter and limited in size by the limit
parameter.
Parameters:
delimiter
-
the delimiter to use to split the string.
limit
-
controls the maximum number of items that will be returned.
Returns:
an array of String instances created by splitting the current String based on the delimiter and limited in size by the limit parameter.
split
Returns an array of String instances created by splitting the current
String based on the regular expression and limited in size by the limit
parameter.
Parameters:
regexp
-
the regular expression to use to split the string.
limit
-
controls the maximum number of items that will be returned.
Returns:
an array of String instances created by splitting the current String based on the regular expression and limited in size by the limit parameter.
substr
Creates and returns a new String by splitting the current string
at the specified start location until the end of the String.
Parameters:
start
-
the start position in the current string from which the new string will be created.
Returns:
a new String created by splitting the current string starting at the specified start location until the end of the String.
substr
Creates and returns a new String by splitting the current string
at the specified start location and limited by the length
value.
Parameters:
start
-
the start position in the current string from which the new string will be created.
length
-
controls the length of the new string.
Returns:
a new String created by splitting the current string starting at the specified start location and limited by the length value.
substring
Creates and returns a new String by splitting the current string
at the specified from location until the end of the String.
Parameters:
from
-
the start position in the current string from which the new string will be created.
Returns:
a new String created by splitting the current string starting at the specified from location until the end of the String.
substring
Creates and returns a new String by splitting the current string
at the specified from location until the specified to location.
Parameters:
from
-
the start position in the current string from which the new string will be created.
to
-
the end position in the current string from which the new string will be created.
Returns:
a new String created by splitting the current string starting at the specified from location until the specified to location. value.
toLocaleLowerCase
Returns a copy of the current string in all lower-case letters.
Returns:
a copy of the current string in all lower-case letters.
toLocaleUpperCase
Returns a copy of the current string in all upper-case letters.
Returns:
a copy of the current string in all upper-case letters.
toLowerCase
Returns a copy of the current string in all lower-case letters.
Returns:
a copy of the current string in all lower-case letters.
toString
Returns a String value of this object.
Returns:
a String value of this object.
toUpperCase
Returns a copy of the current string in all upper-case letters.
Returns:
a copy of the current string in all upper-case letters.
valueOf
Returns a String value of this object.
Returns:
a String value of this object.