Optional
value: anyReadonly
lengthReturns a nonnegative integer Number less than 1114112 (0x110000) that is the code point value of the UTF-16 encoded code point starting at the string element at position pos in the String resulting from converting this object to a String. If there is no element at that position, the result is undefined. If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
Returns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at endPosition – length(this). Otherwise returns false.
Optional
endPosition: numberReturns a <font>
HTML element and sets the size attribute value
A legacy feature for browser compatibility
Returns a <font>
HTML element and sets the size attribute value
A legacy feature for browser compatibility
Protected
groupingProtected
groupingReturns true if searchString appears as a substring of the result of converting this object to a String, at one or more positions that are greater than or equal to position; otherwise, returns false.
search string
Optional
position: numberIf position is undefined, 0 is assumed, so as to search all of the String.
Returns the position of the first occurrence of a substring.
The substring to search for in the string
Optional
position: numberThe index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
Protected
isProtected
isProtected
isDetermines whether two strings are equivalent in the current locale.
String to compare to target string
Determines whether two strings are equivalent in the current or specified locale.
String to compare to target string
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
Optional
options: CollatorOptionsAn object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
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.
Matches a string or an object that supports being matched against, and returns an array containing the results of that search, or null if no matches are found.
An object that supports being matched against.
Returns the String value result of normalizing the string into the normalization form named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"
Returns the String value result of normalizing the string into the normalization form named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
Optional
form: stringApplicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"
Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string.
The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is.
Optional
fillString: stringThe string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020).
Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the start (left) of the current string.
The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is.
Optional
fillString: stringThe string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020).
Replaces text in a string, using a regular expression or search string.
A string or regular expression to search for.
A string containing the text to replace. When the searchValue is a RegExp
, all matches are replaced if the g
flag is set (or only those matches at the beginning, if the y
flag is also present). Otherwise, only the first match of searchValue is replaced.
Replaces text in a string, using a regular expression or search string.
A string to search for.
A function that returns the replacement text.
Rest
...args: any[]Passes a string and replaceValue to the [Symbol.replace]
method on searchValue. This method is expected to implement its own replacement algorithm.
An object that supports searching for and replacing matches within a string.
The replacement text.
Replaces text in a string, using an object that supports replacement within a string.
A object can search for and replace matches within a string.
Rest
...args: any[]A function that returns the replacement text.
Rest
...args: any[]Finds the first substring match in a regular expression search.
The regular expression pattern and applicable flags.
Finds the first substring match in a regular expression search.
An object which supports searching within a string.
Returns a section of a string.
Optional
start: numberThe index to the beginning of the specified portion of stringObj.
Optional
end: numberThe 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.
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.
Optional
limit: numberA value used to limit the number of elements returned in the array.
Split a string into substrings using the specified separator and return them as an array.
An object that can split a string.
Optional
limit: numberOptional
limit: numberA value used to limit the number of elements returned in the array.
Returns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at position. Otherwise returns false.
Optional
position: numberGets 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.
Optional
length: numberThe number of characters to include in the returned substring.
A legacy feature for browser compatibility
Returns the substring at the specified location within a String object.
The zero-based index number indicating the beginning of the substring.
Optional
end: numberZero-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.
Static
fromStatic
fromStatic
rawString.raw is usually used as a tag function of a Tagged Template String. When called as such, the first argument will be a well formed template call site object and the rest parameter will contain the substitution values. It can also be called directly, for example, to interleave strings and values from your own tag function, and in this case the only thing it needs from the first argument is the raw property.
A well-formed template string call site representation.
Rest
...substitutions: any[]A set of substitution values.
Generated using TypeDoc
Returns the length of a String object.