?um/p1-90`The String
extends clause of a class definition. Subclass super call to the String This function performs the following steps when called:
The String
This function may be called with any number of arguments which form the rest parameter codeUnits.
It performs the following steps when called:
The
This function may be called with any number of arguments which form the rest parameter codePoints.
It performs the following steps when called:
The
The initial value of String.prototype is the
This property has the attributes { [[Writable]]:
This function may be called with a variable number of arguments. The first argument is template and the remainder of the arguments form the
It performs the following steps when called:
This function is intended for use as a tag function of a Tagged Template (
The String prototype object:
Unless explicitly stated otherwise, the methods of the String prototype object defined below are not generic and the
This method returns a single element String containing the code unit at index pos within the String value resulting from converting this object to a String. If there is no element at that index, the result is the empty String. The result
If pos is an x.charAt(pos) is equivalent to the result of x.substring(pos, pos + 1).
This method performs the following steps when called:
This method is intentionally generic; it does not require that its
This method returns a Number (a non-negative
This method performs the following steps when called:
This method is intentionally generic; it does not require that its
This method returns a non-negative
This method performs the following steps when called:
This method is intentionally generic; it does not require that its
When this method is called it returns the String value consisting of the code units of the
This method performs the following steps when called:
The
This method is intentionally generic; it does not require that its
The initial value of String.prototype.constructor is
This method performs the following steps when called:
This method returns
Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.
This method is intentionally generic; it does not require that its
This method performs the following steps when called:
If searchString appears as a
Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.
This method is intentionally generic; it does not require that its
If searchString appears as a
This method performs the following steps when called:
This method is intentionally generic; it does not require that its
This method performs the following steps when called:
If searchString appears as a
This method performs the following steps when called:
This method is intentionally generic; it does not require that its
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:
This method returns a Number other than
Before performing the comparisons, this method performs the following steps to prepare the Strings:
The meaning of the optional second and third parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not assign any other interpretation to those parameter positions.
The actual return values are
This method itself is not directly suitable as an argument to Array.prototype.sort because the latter requires a function of two arguments.
This method may rely on whatever language- and/or locale-sensitive comparison functionality is available to the ECMAScript environment from the
// Å ANGSTROM SIGN vs.
// Å LATIN CAPITAL LETTER A + COMBINING RING ABOVE
"\u212B".localeCompare("A\u030A")
// Ω OHM SIGN vs.
// Ω GREEK CAPITAL LETTER OMEGA
"\u2126".localeCompare("\u03A9")
// ṩ LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE vs.
// ṩ LATIN SMALL LETTER S + COMBINING DOT ABOVE + COMBINING DOT BELOW
"\u1E69".localeCompare("s\u0307\u0323")
// ḍ̇ LATIN SMALL LETTER D WITH DOT ABOVE + COMBINING DOT BELOW vs.
// ḍ̇ LATIN SMALL LETTER D WITH DOT BELOW + COMBINING DOT ABOVE
"\u1E0B\u0323".localeCompare("\u1E0D\u0307")
// 가 HANGUL CHOSEONG KIYEOK + HANGUL JUNGSEONG A vs.
// 가 HANGUL SYLLABLE GA
"\u1100\u1161".localeCompare("\uAC00")
For a definition and discussion of canonical equivalence see the Unicode Standard, chapters 2 and 3, as well as Unicode Standard Annex #15, Unicode Normalization Forms and Unicode Technical Note #5, Canonical Equivalence in Applications. Also see Unicode Technical Standard #10, Unicode Collation Algorithm.
It is recommended that this method should not honour Unicode compatibility equivalents or compatibility decompositions as defined in the Unicode Standard, chapter 3, section 3.7.
This method is intentionally generic; it does not require that its
This method performs the following steps when called:
This method is intentionally generic; it does not require that its
This method performs a regular expression match of the String representing the
It performs the following steps when called:
String.prototype.split, String.prototype.matchAll is designed to typically act without mutating its inputs.This method performs the following steps when called:
This method is intentionally generic; it does not require that its
This method performs the following steps when called:
This method performs the following steps when called:
The abstract operation StringPaddingBuiltinsImpl takes arguments O (an
The abstract operation StringPad takes arguments S (a String), maxLength (a non-negative
The argument maxLength will be clamped such that it can be no smaller than the length of S.
The argument fillString defaults to
The abstract operation ToZeroPaddedDecimalString takes arguments n (a non-negative
This method performs the following steps when called:
This method creates the String value consisting of the code units of the
This method is intentionally generic; it does not require that its
This method performs the following steps when called: