String
Accessed via string
The string module provides functions for working with strings in TruScript.
Functions
Returns true if the string is empty, and false otherwise.
Returns the number of characters in the string.
Returns a new string with all characters in the original string converted to uppercase.
Returns a new string with all characters in the original string converted to lowercase.
Returns a new string with all leading and trailing whitespace removed from the original string.
Returns a new string that is a substring of the original string, starting at the specified index and with the specified length.
Returns a new string with all occurrences of the old value replaced with the new value.
Splits the string into an array of substrings based on the specified separator.
Joins an array of strings into a single string, with the specified separator between each string.
Returns true if the string contains the specified substring, and false otherwise.
Returns true if the string starts with the specified prefix, and false otherwise.
Returns true if the string ends with the specified suffix, and false otherwise.
Returns the index of the first occurrence of the specified substring in the string, or -1 if the substring is not found.
Returns the index of the last occurrence of the specified substring in the string, or -1 if the substring is not found.
Returns a new string with the characters in the original string in reverse order.
Returns a new string that is the original string repeated the specified number of times.
Returns a new string that is the original string padded at the start with the specified character until it reaches the specified total length.
Returns a new string that is the original string padded at the end with the specified character until it reaches the specified total length.
Returns true if the string matches the specified regular expression (RegEx) pattern, and false otherwise.