The builtin type varString.
The varString can contain any sequence of Unicode characters, including
NUL.
VarString is mutable. The characters are stored in an optimal way,
depending on the mutations. When possible a string is used. When
appending strings a list of strings is used to avoid reallocation and
copying. When appending characters extra space is allocated to reduce
reallocations.
The characters are UTF-8 encoded. Illegal byte sequences may appear but
cause an exception for operations that work with characters.
The storage is identical to varByteString, a varString can be typecast to
varByteString and the other way around without conversion:
|
$Size()
int @public | Return the size of the varString in characters.
|
|
$ToString()
string @public | Return the varString as a string.
|
|
$toVarString()
string @public | Return the varString as-is, this is a no-op.
|
|
$asVarbyteString()
varByteString @public | Return the varString as a varByteString.
|
|
$toVarbyteString()
varByteString @public | Return the varString as a varByteString.
|
|
$toInt()
int @public | Return the digits at the start of the varString converted to a number.
|
|
$toInt(default)
int @public | Return the digits at the start of the varString converted to a number.
|
|
$quotedToInt()
int @public | Return the digits at the start of the varString converted to a number,
ignoring quotes.
|
|
$quotedToInt(default)
int @public | Return the digits at the start of the varString converted to a number,
ignoring quotes.
|
|
$hexToInt()
int @public | Return the hex digits at the start of the varString converted to a number.
|
|
$hexToInt(default)
int @public | Return the hex digits at the start of the varString converted to a number.
|
|
$quotedHexToInt()
int @public | Return the hex digits at the start of the varString converted to a number,
ignoring quotes.
|
|
$quotedHexToInt(default)
int @public | Return the hex digits at the start of the varString converted to a number,
ignoring quotes.
|
|
$binToInt()
int @public | Return the binary digits at the start of the varString converted to a
number.
|
|
$binToInt(default)
int @public | Return the binary digits at the start of the varString converted to a
number.
|
|
$quotedBinToInt()
int @public | Return the binary digits at the start of the varString converted to a
number, ignoring quotes.
|
|
$quotedBinToInt(default)
int @public | Return the binary digits at the start of the varString converted to a
number, ignoring quotes.
|
|
$toLower()
varString @public | Return a copy of the varString with all characters lower-cased.
|
|
$toLowerAscii()
varString @public | Return a copy of the varString with all ASCII characters lower-cased.
|
|
$toUpper()
varString @public | Return a copy of the varString with all characters upper-cased.
|
|
$toUpperAscii()
varString @public | Return a copy of the varString with all ASCII characters upper-cased.
|
|
$find(s)
int @public | Return the lowest index where varString s appears.
|
|
$find(c)
int @public | Return the lowest index of the character c.
|
|
$find(s, start)
int @public | Return the lowest index where the varString s appears at or after start.
|
|
$find(c, start)
int @public | Return the lowest index of the character c at or after start.
|
|
$findLast(s)
int @public | Return the highest index where varString s appears.
|
|
$findLast(c)
int @public | Return the highest index of the character c.
|
|
$startsWith(s)
bool @public | Return TRUE when the varString starts with s.
|
|
$endsWith(s)
bool @public | Return TRUE when the varString ends with s.
|
|
$hash()
int @public | Return a number that is a hash value of the varString.
|
|
$add(s)
varString @public | Append a string to the varString.
|
|
$slice(start)
varString @public | Return a copy of the varString, starting at index start.
|
|
$slice(start, end)
varString @public | Return a copy of the varString, starting at index start and ending at
end, inclusive.
|
|
$sliceSize(start, length)
varString @public | Return a copy of the varString, starting at index start with up to
length characters.
|
|
$sliceWrap(start)
varString @public | Return a copy of the varString, starting at index start.
|
|
$sliceWrap(start, end)
varString @public | Return a copy of the varString, starting at index start and ending at
end, inclusive.
|
|
$sliceWrapSize(start, length)
varString @public | Return a copy of the varString, starting at index start with up to
length characters
|
|
$split()
list<string> @public | Return a list with the varString split at white space.
|
|
$split(sep)
list<string> @public | Return a list with the varString split into pieces, split at sep.
|
|
$splitAnyOf(charSet)
list<string> @public | Return a list with the varString split at the characters in charSet.
|
|
|