Documentation String by Mozilla Contributors, licensed under CC-BY-SA 2.5.

Static methods

staticinlinecharCodeAt(string:String, index:Int):Int

The charCodeAt() method of String values returns an integer between 0 and 65535 representing the UTF-16 code unit at the given index.

If index is out of range of 0str.length - 1, returns NaN.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt

staticinlinelocaleCompare(string:String, compareString:String, ?locales:EitherType<String, Array<String>>, ?options:CollatorOptions):Bool

Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.

staticinlinenormalize(string:String, form:NormalizationForm):String

Returns the Unicode Normalization Form of the calling string value.

staticreplace(string:String, pattern:String, replacement:String):String

staticreplace(str:String, pattern:RegExp, replacement:String):String

staticreplace(str:String, pattern:RegExp, replacement:String ‑> String):String

staticreplace(str:String, pattern:String, replacement:String ‑> String):String

The replace() method of String values returns a new string with one, some, or all matches of a pattern replaced by a replacement.

The pattern can be a String or a js.lib.RegExp, and the replacement can be a string or a function called for each match.

If pattern is a string, only the first occurrence will be replaced. The original string is left unchanged.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace

staticinlinetoLocaleLowerCase(string:String, ?locales:EitherType<String, Array<String>>):String

The characters within a string are converted to lower case while respecting the current locale. For most languages, this will return the same as toLowerCase().

staticinlinetoLocaleUpperCase(string:String, ?locales:EitherType<String, Array<String>>):String

The characters within a string are converted to upper case while respecting the current locale. For most languages, this will return the same as toUpperCase().