scala.scalajs.js

String

sealed trait String extends Any

Primitive JavaScript string.

Annotations
@RawJSType()
Linear Supertypes
Any, AnyRef, scala.Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. String
  2. Any
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def +(that: Dynamic): String

  2. abstract def +(that: Any): String

  3. abstract def <(that: Dynamic): Boolean

  4. abstract def <(that: String): Boolean

  5. abstract def <=(that: Dynamic): Boolean

  6. abstract def <=(that: String): Boolean

  7. abstract def >(that: Dynamic): Boolean

  8. abstract def >(that: String): Boolean

  9. abstract def >=(that: Dynamic): Boolean

  10. abstract def >=(that: String): Boolean

Concrete Value Members

  1. final def !=(arg0: scala.Any): scala.Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def +(that: String): String

    Definition Classes
    StringAny
  4. final def ==(arg0: scala.Any): scala.Boolean

    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def charAt(pos: Number): String

    The chartAt() method returns the specified character from a string.

    The chartAt() method returns the specified character from a string.

    Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1. If the index you supply is out of range, JavaScript returns an empty string.

    MDN

  7. def charCodeAt(index: Number): Number

    The charCodeAt() method returns the numeric Unicode value of the character at the given index (except for unicode codepoints > 0x10000).

    The charCodeAt() method returns the numeric Unicode value of the character at the given index (except for unicode codepoints > 0x10000).

    MDN

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def concat(strings: String*): String

    concat combines the text from one or more strings and returns a new string.

    concat combines the text from one or more strings and returns a new string. Changes to the text in one string do not affect the other string. MDN

  10. final def eq(arg0: AnyRef): scala.Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: scala.Any): scala.Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. def indexOf(searchString: String): Number

  16. def indexOf(searchString: String, position: Number): Number

    Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex,

    Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex,

    returns -1 if the value is not found.

    MDN

  17. final def isInstanceOf[T0]: scala.Boolean

    Definition Classes
    Any
  18. def lastIndexOf(searchString: String): Number

  19. def lastIndexOf(searchString: String, position: Number): Number

    Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found.

    Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex.

    MDN

  20. val length: Number

    This property returns the number of code units in the string.

    This property returns the number of code units in the string. UTF-16, the string format used by JavaScript, uses a single 16-bit code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, so it's possible for the value returned by length to not match the actual number of characters in the string.

    For an empty string, length is 0.

    MDN

  21. def localeCompare(that: String): Number

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

    Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order. The new locales and options arguments let applications specify the language whose sort order should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale and sort order used are entirely implementation dependent.

    MDN

  22. def match(regexp: RegExp): Array[String]

  23. def match(regexp: String): Array[String]

    Used to retrieve the matches when matching a string against a regular expression.

    Used to retrieve the matches when matching a string against a regular expression.

    If the regular expression does not include the g flag, returns the same result as regexp.exec(string). The returned Array has an extra input property, which contains the original string that was parsed. In addition, it has an index property, which represents the zero-based index of the match in the string.

    If the regular expression includes the g flag, the method returns an Array containing all matches. If there were no matches, the method returns null.

    MDN

  24. final def ne(arg0: AnyRef): scala.Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def replace(searchValue: RegExp, replaceValue: Any): String

  28. def replace(searchValue: RegExp, replaceValue: String): String

  29. def replace(searchValue: String, replaceValue: Any): String

  30. def replace(searchValue: String, replaceValue: String): String

    Returns a new string with some or all matches of a pattern replaced by a replacement.

    Returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match.

    This method does not change the String object it is called on. It simply returns a new string.

    To perform a global search and replace, either include the g switch in the regular expression or if the first parameter is a string, include g in the flags parameter.

    MDN

  31. def search(regexp: RegExp): Number

  32. def search(regexp: String): Number

    If successful, search returns the index of the regular expression inside the string.

    If successful, search returns the index of the regular expression inside the string. Otherwise, it returns -1.

    When you want to know whether a pattern is found in a string use search (similar to the regular expression test method); for more information (but slower execution) use match (similar to the regular expression exec method).

    MDN

  33. def slice(start: Number): String

  34. def slice(start: Number, end: Number): String

    slice extracts the text from one string and returns a new string.

    slice extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string.

    slice extracts up to but not including endSlice. string.slice(1,4) extracts the second character through the fourth character (characters indexed 1, 2, and 3).

    As an example, string.slice(2,-1) extracts the third character through the second to last character in the string.

    MDN

  35. def split(separator: RegExp): Array[String]

  36. def split(separator: RegExp, limit: Number): Array[String]

  37. def split(separator: String): Array[String]

  38. def split(separator: String, limit: Number): Array[String]

    Splits a String object into an array of strings by separating the string into substrings.

    Splits a String object into an array of strings by separating the string into substrings.

    When found, separator is removed from the string and the substrings are returned in an array. If separator is omitted, the array contains one element consisting of the entire string. If separator is an empty string, string is converted to an array of characters.

    If separator is a regular expression that contains capturing parentheses, then each time separator is matched, the results (including any undefined results) of the capturing parentheses are spliced into the output array. However, not all browsers support this capability.

    Note: When the string is empty, split returns an array containing one empty string, rather than an empty array.

    MDN

  39. def substring(start: Number): String

  40. def substring(start: Number, end: Number): String

    Returns a subset of a string between one index and another, or through the end of the string.

    Returns a subset of a string between one index and another, or through the end of the string.

    MDN

  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  42. def toLocaleLowerCase(): String

    The toLocaleLowerCase method returns the value of the string converted to lower case according to any locale-specific case mappings.

    The toLocaleLowerCase method returns the value of the string converted to lower case according to any locale-specific case mappings. toLocaleLowerCase does not affect the value of the string itself. In most cases, this will produce the same result as toLowerCase(), but for some locales, such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may be a different result.

    MDN

  43. def toLocaleUpperCase(): String

    The toLocaleUpperCase method returns the value of the string converted to upper case according to any locale-specific case mappings.

    The toLocaleUpperCase method returns the value of the string converted to upper case according to any locale-specific case mappings. toLocaleUpperCase does not affect the value of the string itself. In most cases, this will produce the same result as toUpperCase(), but for some locales, such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may be a different result.

    MDN

  44. def toLowerCase(): String

    Returns the calling string value converted to lowercase.

    Returns the calling string value converted to lowercase.

    MDN

  45. def toString(): java.lang.String

    Definition Classes
    AnyRef → Any
  46. def toUpperCase(): String

    Returns the calling string value converted to uppercase.

    Returns the calling string value converted to uppercase.

    MDN

  47. def trim(): String

    Removes whitespace from both ends of the string.

    Removes whitespace from both ends of the string.

    MDN

  48. def unary_!(): Boolean

    Definition Classes
    Any
  49. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Any

Inherited from AnyRef

Inherited from scala.Any

Ungrouped