Provides extensions to the base ECMAScript (JavaScript) String object by including static and instance methods. String Type Extensions
string
string
Returns the length of a String object.
Returns the character at the specified index.
The zero-based index of the desired character.
string
Returns the Unicode value of the character at the specified location.
The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
number
Returns a string that contains the concatenation of two or more strings.
The strings to append to the end of the string.
string
Formats a number by using the invariant culture.
boolean
true if the end of the String object matches suffix; otherwise, false.
Replaces each format item in a String object with the text equivalent of a corresponding object's value.
string
A copy of the string with the formatting applied.
string
Returns the position of the first occurrence of a substring.
The substring to search for in the string
The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
number
Returns the last occurrence of a substring in the string.
The substring to search for.
The index at which to begin searching. If omitted, the search begins at the end of the string.
number
Determines whether two strings are equivalent in the current locale.
String to compare to target string
number
Replaces the format items in a String object with the text equivalent of a corresponding object's value. The current culture is used to format dates and numbers.
string
A copy of the string with the formatting applied.
Matches a string with a regular expression, and returns an array containing the results of that search.
A variable name or string literal containing the regular expression pattern and flags.
Array<string>
Matches a string with a regular expression, and returns an array containing the results of that search.
A regular expression object that contains the regular expression pattern and applicable flags.
Array<string>
Replaces text in a string, using a regular expression or search string.
A String object or string literal that represents the regular expression
A String object or string literal containing the text to replace for every successful match of rgExp in stringObj.
string
Replaces text in a string, using a regular expression or search string.
A String object or string literal that represents the regular expression
A function that returns the replacement text.
string
Replaces text in a string, using a regular expression or search string.
A Regular Expression object containing the regular expression pattern and applicable flags
A String object or string literal containing the text to replace for every successful match of rgExp in stringObj.
string
Replaces text in a string, using a regular expression or search string.
A Regular Expression object containing the regular expression pattern and applicable flags
A function that returns the replacement text.
string
Finds the first substring match in a regular expression search.
The regular expression pattern and applicable flags.
number
Finds the first substring match in a regular expression search.
The regular expression pattern and applicable flags.
number
Returns a section of a string.
The index to the beginning of the specified portion of stringObj.
The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. If this value is not specified, the substring continues to the end of stringObj.
string
Split a string into substrings using the specified separator and return them as an array.
A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
A value used to limit the number of elements returned in the array.
Array<string>
Split a string into substrings using the specified separator and return them as an array.
A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
A value used to limit the number of elements returned in the array.
Array<string>
Gets a substring beginning at the specified location and having the specified length.
The starting position of the desired substring. The index of the first character in the string is zero.
The number of characters to include in the returned substring.
string
Returns the substring at the specified location within a String object.
The zero-based index number indicating the beginning of the substring.
Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. If end is omitted, the characters from start through the end of the original string are returned.
string
Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.
string
Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.
string
Converts all the alphabetic characters in a string to lowercase.
string
Returns a string representation of a string.
string
Converts all the alphabetic characters in a string to uppercase.
string
Removes leading and trailing white-space characters from a String object.
string
A copy of the string with all white-space characters removed from the start and end of the string.
Removes trailing white-space characters from a String object.
string
A copy of the string with all white-space characters removed from the end of the string.
Removes leading white-space characters from a String object.
string
A copy of the string with all white-space characters removed from the start of the string.