String

@JSGlobal("String") @native @JSType class String() extends StObject with String
Companion
object
trait String
trait NumberDictionary[String]
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Constructors

def this(value: Any)

Inherited methods

def `match`(regexp: RegExp): RegExpMatchArray | Null
Inherited from
String
def `match`(regexp: String): RegExpMatchArray | Null

Matches a string with a regular expression, and returns an array containing the results of that search.

Matches a string with a regular expression, and returns an array containing the results of that search.

Value Params
regexp

A variable name or string literal containing the regular expression pattern and flags.

Inherited from
String
def `match`(matcher: Match): RegExpMatchArray | Null

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.

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.

Value Params
matcher

An object that supports being matched against.

Inherited from
String
def anchor(name: String): String

Returns an <a> HTML anchor element and sets the name attribute to the text value

Returns an <a> HTML anchor element and sets the name attribute to the text value

Inherited from
String
def big(): String

Returns a <big> HTML element

Returns a <big> HTML element

Inherited from
String
def bold(): String

Returns a <b> HTML element

Returns a <b> HTML element

Inherited from
String
def charAt(pos: Double): String

Returns the character at the specified index.

Returns the character at the specified index.

Value Params
pos

The zero-based index of the desired character.

Inherited from
String
def charCodeAt(index: Double): Double

Returns the Unicode value of the character at the specified location.

Returns the Unicode value of the character at the specified location.

Value Params
index

The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.

Inherited from
String
def codePointAt(pos: Double): UndefOr[Double]

Returns 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 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.

Inherited from
String
def concat(strings: String*): String

Returns a string that contains the concatenation of two or more strings.

Returns a string that contains the concatenation of two or more strings.

Value Params
strings

The strings to append to the end of the string.

Inherited from
String
def endsWith(searchString: String, endPosition: Double): Boolean
Inherited from
String
def endsWith(searchString: String): Boolean

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.

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.

Inherited from
String
def fixed(): String

Returns a <tt> HTML element

Returns a <tt> HTML element

Inherited from
String
def fontcolor(color: String): String

Returns a <font> HTML element and sets the color attribute value

Returns a <font> HTML element and sets the color attribute value

Inherited from
String
def fontsize(size: Double): String

Returns a <font> HTML element and sets the size attribute value

Returns a <font> HTML element and sets the size attribute value

Inherited from
String
def fontsize(size: String): String

Returns a <font> HTML element and sets the size attribute value

Returns a <font> HTML element and sets the size attribute value

Inherited from
String
def hasOwnProperty(v: String): Boolean
Inherited from
Object
def includes(searchString: String, position: Double): Boolean
Inherited from
String
def includes(searchString: String): Boolean

Returns 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.

Returns 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.

Value Params
position

If position is undefined, 0 is assumed, so as to search all of the String.

searchString

search string

Inherited from
String
def indexOf(searchString: String, position: Double): Double
Inherited from
String
def indexOf(searchString: String): Double

Returns the position of the first occurrence of a substring.

Returns the position of the first occurrence of a substring.

Value Params
position

The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.

searchString

The substring to search for in the string

Inherited from
String
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def italics(): String

Returns an <i> HTML element

Returns an <i> HTML element

Inherited from
String
def lastIndexOf(searchString: String, position: Double): Double
Inherited from
String
def lastIndexOf(searchString: String): Double

Returns the last occurrence of a substring in the string.

Returns the last occurrence of a substring in the string.

Value Params
position

The index at which to begin searching. If omitted, the search begins at the end of the string.

searchString

The substring to search for.

Inherited from
String
def localeCompare(that: String, locales: Unit, options: CollatorOptions): Double
Inherited from
String
def localeCompare(that: String, locales: Array[String], options: CollatorOptions): Double
Inherited from
String
def localeCompare(that: String, locales: Array[String]): Double
Inherited from
String
def localeCompare(that: String, locales: String, options: CollatorOptions): Double
Inherited from
String
def localeCompare(that: String, locales: String): Double
Inherited from
String
def localeCompare(that: String): Double

Determines whether two strings are equivalent in the current locale.

Determines whether two strings are equivalent in the current locale.

Value Params
that

String to compare to target string

Inherited from
String

Matches a string with a regular expression, and returns an iterable of matches containing the results of that search.

Matches a string with a regular expression, and returns an iterable of matches containing the results of that search.

Value Params
regexp

A variable name or string literal containing the regular expression pattern and flags.

Inherited from
String
def normalize(form: String): String
Inherited from
String
def normalize(): String

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.

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.

Value Params
form

Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"

Inherited from
String
@JSName("normalize")
def normalize_NFC(form: NFC): String

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.

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.

Value Params
form

Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"

Inherited from
String
@JSName("normalize")
def normalize_NFD(form: NFD): String
Inherited from
String
@JSName("normalize")
def normalize_NFKC(form: NFKC): String
Inherited from
String
@JSName("normalize")
def normalize_NFKD(form: NFKD): String
Inherited from
String
def padEnd(maxLength: Double, fillString: String): String
Inherited from
String
def padEnd(maxLength: Double): String

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.

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.

Value Params
fillString

The 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).

maxLength

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.

Inherited from
String
def padStart(maxLength: Double, fillString: String): String
Inherited from
String
def padStart(maxLength: Double): String

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.

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.

Value Params
fillString

The 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).

maxLength

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.

Inherited from
String
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def repeat(count: Double): String

Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned.

Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned.

Value Params
count

number of copies to append

Inherited from
String
def replace(searchValue: RegExp, replacer: Function2[String, Any, String]): String
Inherited from
String
def replace(searchValue: RegExp, replaceValue: String): String
Inherited from
String
def replace(searchValue: String, replacer: Function2[String, Any, String]): String

Replaces text in a string, using a regular expression or search string.

Replaces text in a string, using a regular expression or search string.

Value Params
replacer

A function that returns the replacement text.

searchValue

A string to search for.

Inherited from
String
def replace(searchValue: String, replaceValue: String): String

Replaces text in a string, using a regular expression or search string.

Replaces text in a string, using a regular expression or search string.

Value Params
replaceValue

A string containing the text to replace for every successful match of searchValue in this string.

searchValue

A string to search for.

Inherited from
String
def replace(searchValue: 0, replacer: Function2[String, Any, String]): String

Replaces text in a string, using an object that supports replacement within a string.

Replaces text in a string, using an object that supports replacement within a string.

Value Params
replacer

A function that returns the replacement text.

searchValue

A object can search for and replace matches within a string.

Inherited from
String
def replace(searchValue: Replace, replaceValue: String): String

Replaces text in a string, using an object that supports replacement within a string.

Replaces text in a string, using an object that supports replacement within a string.

Value Params
replaceValue

A string containing the text to replace for every successful match of searchValue in this string.

searchValue

A object can search for and replace matches within a string.

Inherited from
String
def search(searcher: Search): Double

Finds the first substring match in a regular expression search.

Finds the first substring match in a regular expression search.

Value Params
searcher

An object which supports searching within a string.

Inherited from
String
def search(regexp: RegExp): Double
Inherited from
String
def search(regexp: String): Double

Finds the first substring match in a regular expression search.

Finds the first substring match in a regular expression search.

Value Params
regexp

The regular expression pattern and applicable flags.

Inherited from
String
def slice(start: Unit, end: Double): String
Inherited from
String
def slice(start: Double, end: Double): String
Inherited from
String
def slice(start: Double): String
Inherited from
String
def slice(): String

Returns a section of a string.

Returns a section of a string.

Value Params
end

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.

start

The index to the beginning of the specified portion of stringObj.

Inherited from
String
def small(): String

Returns a <small> HTML element

Returns a <small> HTML element

Inherited from
String
def split(splitter: Split, limit: Double): Array[String]
Inherited from
String
def split(splitter: Split): Array[String]

Split a string into substrings using the specified separator and return them as an array.

Split a string into substrings using the specified separator and return them as an array.

Value Params
limit

A value used to limit the number of elements returned in the array.

splitter

An object that can split a string.

Inherited from
String
def split(separator: RegExp, limit: Double): Array[String]
Inherited from
String
def split(separator: RegExp): Array[String]
Inherited from
String
def split(separator: String, limit: Double): Array[String]
Inherited from
String
def split(separator: String): Array[String]

Split a string into substrings using the specified separator and return them as an array.

Split a string into substrings using the specified separator and return them as an array.

Value Params
limit

A value used to limit the number of elements returned in the array.

separator

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.

Inherited from
String
def startsWith(searchString: String, position: Double): Boolean
Inherited from
String
def startsWith(searchString: String): Boolean

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.

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.

Inherited from
String
def strike(): String

Returns a <strike> HTML element

Returns a <strike> HTML element

Inherited from
String
def sub(): String

Returns a <sub> HTML element

Returns a <sub> HTML element

Inherited from
String
def substr(from: Double, length: Double): String
Inherited from
String
def substr(from: Double): String

Gets a substring beginning at the specified location and having the specified length.

Gets a substring beginning at the specified location and having the specified length.

Value Params
from

The starting position of the desired substring. The index of the first character in the string is zero.

length

The number of characters to include in the returned substring.

Inherited from
String
def substring(start: Double, end: Double): String
Inherited from
String
def substring(start: Double): String

Returns the substring at the specified location within a String object.

Returns the substring at the specified location within a String object.

Value Params
end

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.

start

The zero-based index number indicating the beginning of the substring.

Inherited from
String
def sup(): String

Returns a <sup> HTML element

Returns a <sup> HTML element

Inherited from
String
def toLocaleLowerCase(locales: Array[String]): String
Inherited from
String
def toLocaleLowerCase(locales: String): String
Inherited from
String
def toLocaleLowerCase(): String

Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.

Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.

Inherited from
String
def toLocaleString(): String
Inherited from
Object
def toLocaleUpperCase(locales: Array[String]): String
Inherited from
String
def toLocaleUpperCase(locales: String): String
Inherited from
String
def toLocaleUpperCase(): String

Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.

Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.

Inherited from
String
def toLowerCase(): String

Converts all the alphabetic characters in a string to lowercase.

Converts all the alphabetic characters in a string to lowercase.

Inherited from
String
def toUpperCase(): String

Converts all the alphabetic characters in a string to uppercase.

Converts all the alphabetic characters in a string to uppercase.

Inherited from
String
def trim(): String

Removes the leading and trailing white space and line terminator characters from a string.

Removes the leading and trailing white space and line terminator characters from a string.

Inherited from
String
def trimEnd(): String

Removes the trailing white space and line terminator characters from a string.

Removes the trailing white space and line terminator characters from a string.

Inherited from
String
def trimLeft(): String

Removes the leading white space and line terminator characters from a string.

Removes the leading white space and line terminator characters from a string.

Inherited from
String
def trimRight(): String

Removes the trailing white space and line terminator characters from a string.

Removes the trailing white space and line terminator characters from a string.

Inherited from
String
def trimStart(): String

Removes the leading white space and line terminator characters from a string.

Removes the leading white space and line terminator characters from a string.

Inherited from
String
def valueOf(): Any
Inherited from
Object

Inherited fields

@JSName
var iterator: Function0[IterableIterator[String]]

Iterator

Iterator

Inherited from
String
val length: Double

Returns the length of a String object.

Returns the length of a String object.

Inherited from
String