Built-in string class.
This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.
Return true if the strings begins with the given string.
Return the bigrams (pairs of consecutive letters) of this string.
Return a copy of the string with special characters escaped using the C language standard.
Return a copy of the string with escaped characters replaced by their meanings according to the C language standard.
Change the case of some letters. Replace underscores with spaces, convert all letters to lowercase then capitalize first and every letter following the space character. For [code]capitalize camelCase mixed_with_underscores[/code] it will return [code]Capitalize Camelcase Mixed With Underscores[/code].
Perform a case-sensitive comparison to another string, return -1 if less, 0 if equal and +1 if greater.
Return true if the string is empty.
Return true if the strings ends with the given string.
Erase [code]chars[/code] characters from the string starting from [code]pos[/code].
Find the first occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
Find the last occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
Find the first occurrence of a substring but search as case-insensitive, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
If the string is a path to a file, return the base directory.
If the string is a path to a file, return the path to the file without the extension.
If the string is a path to a file, return the extension.
If the string is a path to a file, return the file and ignore the base directory.
Hash the string and return a 32 bits integer.
Convert a string containing a hexadecimal number into an int.
Insert a substring at a given position.
If the string is a path to a file or directory, return true if the path is absolute.
If the string is a path to a file or directory, return true if the path is relative.
Check whether this string is a subsequence of the given string.
Check whether this string is a subsequence of the given string, without considering case.
Check whether the string contains a valid float.
Check whether the string contains a valid color in HTML notation.
Check whether the string is a valid identifier. As is common in programming languages, a valid identifier may contain only letters, digits and underscores (_) and the first character may not be a digit.
Check whether the string contains a valid integer.
Check whether the string contains a valid IP address.
Return a copy of the string with special characters escaped using the JSON standard.
Return an amount of characters from the left of the string.
Return the length of the string in characters.
Do a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'.
Do a simple case insensitive expression match, using ? and * wildcards (see [method match]).
Return the MD5 hash of the string as an array of bytes.
Return the MD5 hash of the string as a string.
Perform a case-insensitive comparison to another string, return -1 if less, 0 if equal and +1 if greater.
Return the character code at position [code]at[/code].
Format a number to have an exact number of [code]digits[/code] after the decimal point.
Format a number to have an exact number of [code]digits[/code] before the decimal point.
Decode a percent-encoded string. See [method percent_encode].
Percent-encode a string. This is meant to encode parameters in a URL when sending a HTTP GET request and bodies of form-urlencoded POST request.
If the string is a path, this concatenates [code]file[/code] at the end of the string as a subpath. E.g. [code]"this/is".plus_file("path") == "this/is/path"[/code].
Replace occurrences of a substring for different ones inside the string.
Replace occurrences of a substring for different ones inside the string, but search case-insensitive.
Perform a search for a substring, but start from the end of the string instead of the beginning.
Perform a search for a substring, but start from the end of the string instead of the beginning. Also search case-insensitive.
Return the right side of the string from a given position.
Return the SHA-256 hash of the string as a string.
Return the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar.
Split the string by a divisor string, return an array of the substrings. Example "One,Two,Three" will return ["One","Two","Three"] if split by ",".
Split the string in floats by using a divisor string, return an array of the substrings. Example "1,2.5,3" will return [1,2.5,3] if split by ",".
Return a copy of the string stripped of any non-printable character at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively.
Return part of the string from the position [code]from[/code], with length [code]len[/code].
Convert the String (which is a character array) to PoolByteArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
Convert a string, containing a decimal number, into a [code]float[/code].
Convert a string, containing an integer number, into an [code]int[/code].
Return the string converted to lowercase.
Return the string converted to uppercase.
Convert the String (which is an array of characters) to PoolByteArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
Return a copy of the string with special characters escaped using the XML standard.
Return a copy of the string with escaped characters replaced by their meanings according to the XML standard.