String library ("string")
This library contains the string handling functions. In all functions, except the utf-8 ones, it is assumed that strings are byte buffers where each byte is one character. If correct indices are applied, many of them will work with multibyte strings.
Objects:
- string_utf8_iterator - UTF-8 code point iterator
Functions:
- string_cut - extract a substring from a string from the specified beginning / end offsets
- string_part - extract a substring from a string from the specified offset and length
- string_reverse - reverse the order of bytes in a string
- string_pad - pad one or both sides of a string with a pattern string up to the specified length
- string_repeat - concatenate several copies of the specified string
- string_count - count occurences of a substring in a string
- string_find - find first substring in the string, optionally after the specified position
- string_find_rev - find a substring by walking the string backwards, optionally before the specified position
- string_replace - replace parts of string according to match / replacement strings or arrays
- string_translate - replace parts of string according to the provided match -> replacement mapping dict
- string_trim - trim one or both sides of string, removing the specified or default character set
- string_toupper - convert all ASCII lowercase characters into uppercase equivalents
- string_tolower - convert all ASCII uppercase characters into lowercase equivalents
- string_compare - compare strings as byte arrays
- string_implode - combine an array of strings, putting a separator string between each two consecutive strings
- string_explode - split string into parts, separated by the specified separator string
- string_charcode - get the character code (byte value, as integer) from the specified position in string
- string_frombytes - make a string from an array of integer values, interpreted as bytes
- string_utf8_decode - decode a UTF-8 string into an array of code points
- string_utf8_encode - encode an array of code points into a UTF-8 string
- string_utf8_offset - get byte offset of a specific character
- string_utf8_length - get UTF-8 length of string or its part
- string_utf8_iterator - create an iterator for UTF-8 code points in a string
- string_format - format variables according to the specified format string
Constants:
- STRING_NO_REV_INDEX - used by string_cut / string_part - disable handling of negative indices
- STRING_STRICT_RANGES - used by string_cut / string_part - disable handling of out-of-bounds indices
- STRING_TRIM_LEFT, STRING_TRIM_RIGHT - used by string_trim - specify sides to be trimmed
- STRING_PAD_LEFT, STRING_PAD_RIGHT - used by string_pad - specify sides to be padded
In this section:
- string_utf8_iterator [object]
- string_cut [function]
- string_part [function]
- string_reverse [function]
- string_pad [function]
- string_repeat [function]
- string_count [function]
- string_find [function]
- string_find_rev [function]
- string_replace [function]
- string_translate [function]
- string_trim [function]
- string_toupper [function]
- string_tolower [function]
- string_compare [function]
- string_implode [function]
- string_explode [function]
- string_charcode [function]
- string_frombytes [function]
- string_utf8_decode [function]
- string_utf8_encode [function]
- string_utf8_offset [function]
- string_utf8_length [function]
- string_utf8_iterator [function]
- string_format [function]
- ALL SGScript string functions (A-Z)