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
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
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
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
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
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
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
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
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
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
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
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
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
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
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
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
Returns the calling string value converted to lowercase.
Returns the calling string value converted to lowercase.
MDN
Returns the calling string value converted to uppercase.
Returns the calling string value converted to uppercase.
MDN
Removes whitespace from both ends of the string.
Removes whitespace from both ends of the string.
MDN
(string: java.lang.String).+(arg0)
(string: any2stringadd[String]).+(other)
(string: StringOps).<(that)
(string: StringOps).<=(that)
(string: StringOps).>(that)
(string: StringOps).>=(that)
(string: java.lang.String).charAt(arg0)
(string: java.lang.String).compareTo(arg0)
(string: StringOps).compareTo(that)
(string: java.lang.String).concat(arg0)
(string: java.lang.String).equals(arg0)
(string: java.lang.String).hashCode()
(string: java.lang.String).indexOf(arg0, arg1)
(string: java.lang.String).indexOf(arg0)
(string: java.lang.String).indexOf(arg0, arg1)
(string: java.lang.String).indexOf(arg0)
(string: StringOps).indexOf(elem, from)
(string: StringOps).indexOf(elem)
(string: java.lang.String).lastIndexOf(arg0, arg1)
(string: java.lang.String).lastIndexOf(arg0)
(string: java.lang.String).lastIndexOf(arg0, arg1)
(string: java.lang.String).lastIndexOf(arg0)
(string: StringOps).lastIndexOf(elem, end)
(string: StringOps).lastIndexOf(elem)
(string: java.lang.String).length()
(string: StringOps).length
(string: java.lang.String).replace(arg0, arg1)
(string: java.lang.String).replace(arg0, arg1)
(string: StringOps).slice(from, until)
(string: java.lang.String).split(arg0)
(string: java.lang.String).split(arg0, arg1)
(string: StringOps).split(separators)
(string: StringOps).split(separator)
(string: java.lang.String).substring(arg0, arg1)
(string: java.lang.String).substring(arg0)
(string: java.lang.String).toLowerCase()
(string: java.lang.String).toLowerCase(arg0)
(string: java.lang.String).toString()
(string: StringOps).toString()
(string: java.lang.String).toUpperCase()
(string: java.lang.String).toUpperCase(arg0)
(string: java.lang.String).trim()
(Since version ) see corresponding Javadoc for more information.
(Since version 2.11.0) Use lines
instead.
(Since version 0.5.0)
Primitive JavaScript string.
In most situations, you should not need this trait, and use java.lang.String instead.