Functions -
lang.string
codePointCompare | Lexicographically compare strings using their Unicode code points. This will allow strings to be ordered in a consistent and well-defined way, but the ordering will not typically be consistent with cultural expectations for sorted order. |
concat | Concatenate all the |
endsWith | Returns true if |
fromBytes | Convert back to a string from its UTF-8 representation in |
fromCodePointInts | Creates a string from an array of ints representing its code points.
Returns an error if any member of |
getCodePoint | Returns the unicode codepoint at index |
indexOf | Returns the index of the first occurrence of |
iterator | Returns an iterator over the string The iterator will return the substrings of length 1 in order. |
join | Returns a new string composed of |
length | Returns the length of the string. |
startsWith | Returns true if |
substring | Returns a string that is a substring of this string. |
toBytes | Represents |
toCodePointInts | Returns an array with an int for each code point in |
toLowerAscii | Return A-Z into a-z and leave other characters unchanged. |
toUpperAscii | Return a-z into A-Z and leave other characters unchanged. |
trim | Remove ASCII white space characters (0x9...0xD, 0x20) from start and end of |
Lexicographically compare strings using their Unicode code points. This will allow strings to be ordered in a consistent and well-defined way, but the ordering will not typically be consistent with cultural expectations for sorted order.
-
Return Type
(int) whether
str1
is greater thanstr2
Concatenate all the strs
. Empty string if empty.
Parameters
- strs string[]
-
strings to concat
-
Return Type
(string) concatanated string
Returns true if str
end with substr
.
-
Return Type
(boolean) whether
str
ends withsubstr
Convert back to a string from its UTF-8 representation in bytes
.
Parameters
- bytes byte[]
-
UTF-8 byte array
Creates a string from an array of ints representing its code points.
Returns an error if any member of codePoints
is negative or greater than 0x10FFFF
or is a surrogate (i.e. in the range 0xD800 or 0xDFFF inclusive).
Parameters
- codePoints int[]
Returns the unicode codepoint at index i
.
-
Return Type
(int) code point
Returns the index of the first occurrence of substr
in the part of the str
starting at startIndex
or nil if it does not occur.
-
Return Type
(int?) index of first
substr
occurrence or nil
Returns an iterator over the string The iterator will return the substrings of length 1 in order.
Parameters
- str string
-
the string
-
Return Type
($anonType$2) iterator object
Returns a new string composed of strs
elements joined together with separator
.
-
Return Type
(string) joined string
Returns the length of the string.
Parameters
- str string
-
the string
-
Return Type
(int) length of the
str
Returns true if str
starts with substr
.
-
Return Type
(boolean) whether
str
starts withsubstr
Returns a string that is a substring of this string.
Parameters
- str string
-
source string.
- startIndex int
-
the beginning index, inclusive.
- endIndex int
-
the ending index, exclusive.
-
Return Type
(string) specified substring.
Represents str
as an array of bytes using UTF-8.
Parameters
- str string
-
the string
-
Return Type
(byte[]) UTF-8 byte array
Returns an array with an int for each code point in str
.
Parameters
- str string
-
the string
-
Return Type
(int[]) CodePoint array
Return A-Z into a-z and leave other characters unchanged.
Parameters
- str string
-
the string
-
Return Type
(string) lower Ascii cased string