trait JSStringOps extends Any
Operations on JavaScript strings.
The methods with an equivalent signature in String but
with a different meaning are prefixed by js
in this trait.
- Annotations
- @JSType()
- Alphabetic
- By Inheritance
- JSStringOps
- Any
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
jsIndexOf(searchString: String): Int
- Annotations
- @JSName( name = "indexOf" )
-
abstract
def
jsIndexOf(searchString: String, position: Int): Int
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
- Annotations
- @JSName( name = "indexOf" )
-
abstract
def
jsLastIndexOf(searchString: String): Int
- Annotations
- @JSName( name = "lastIndexOf" )
-
abstract
def
jsLastIndexOf(searchString: String, position: Int): Int
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
- Annotations
- @JSName( name = "lastIndexOf" )
-
abstract
def
jsReplace(searchValue: RegExp, replaceValue: Any): String
- Annotations
- @JSName( name = "replace" )
-
abstract
def
jsReplace(searchValue: RegExp, replaceValue: String): String
- Annotations
- @JSName( name = "replace" )
-
abstract
def
jsReplace(searchValue: String, replaceValue: Any): String
- Annotations
- @JSName( name = "replace" )
-
abstract
def
jsReplace(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
- Annotations
- @JSName( name = "replace" )
-
abstract
def
jsSlice(start: Int): String
- Annotations
- @JSName( name = "slice" )
-
abstract
def
jsSlice(start: Int, end: Int): 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
- Annotations
- @JSName( name = "slice" )
-
abstract
def
jsSplit(separator: RegExp): Array[String]
- Annotations
- @JSName( name = "split" )
-
abstract
def
jsSplit(separator: RegExp, limit: Int): Array[String]
- Annotations
- @JSName( name = "split" )
-
abstract
def
jsSplit(separator: String): Array[String]
- Annotations
- @JSName( name = "split" )
-
abstract
def
jsSplit(separator: String, limit: Int): 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
- Annotations
- @JSName( name = "split" )
-
abstract
def
jsSubstring(start: Int): String
- Annotations
- @JSName( name = "substring" )
-
abstract
def
jsSubstring(start: Int, end: Int): 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
- Annotations
- @JSName( name = "substring" )
-
abstract
def
localeCompare(that: String): Int
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
- abstract def match(regexp: RegExp): Array[String]
-
abstract
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
-
abstract
def
normalize(): String
ECMAScript 6 Returns the Unicode Normalization Form of this string, with the NFC form.
-
abstract
def
normalize(form: UnicodeNormalizationForm): String
ECMAScript 6 Returns the Unicode Normalization Form of this string.
- abstract def search(regexp: RegExp): Int
-
abstract
def
search(regexp: String): Int
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
-
abstract
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
-
abstract
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
Concrete Value Members
-
final
def
!=(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from JSStringOps to any2stringadd[JSStringOps] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (JSStringOps, B)
- Implicit
- This member is added by an implicit conversion from JSStringOps to ArrowAssoc[JSStringOps] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
ensuring(cond: (JSStringOps) ⇒ Boolean, msg: ⇒ scala.Any): JSStringOps
- Implicit
- This member is added by an implicit conversion from JSStringOps to Ensuring[JSStringOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (JSStringOps) ⇒ Boolean): JSStringOps
- Implicit
- This member is added by an implicit conversion from JSStringOps to Ensuring[JSStringOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ scala.Any): JSStringOps
- Implicit
- This member is added by an implicit conversion from JSStringOps to Ensuring[JSStringOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): JSStringOps
- Implicit
- This member is added by an implicit conversion from JSStringOps to Ensuring[JSStringOps] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from JSStringOps to StringFormat[JSStringOps] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
→[B](y: B): (JSStringOps, B)
- Implicit
- This member is added by an implicit conversion from JSStringOps to ArrowAssoc[JSStringOps] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc