Class StringUtils

Methods

format(str: string, values: table<string, any>?): string
Modifier: static
Note: @nodiscard - Return value should not be ignored
Replaces placeholders between dollar signs in a string with the result of evaluating the Lua expression and placeholders between curly braces in a string with corresponding values from a table. of the placeholders to replace.
Parameters:
  • str (string): The string containing placeholders.
  • values (table<string, any>?): A table with the keys and values
Returns: formatted the formatted string
dumpTable(tbl: table, parents: table<table>?): string
Modifier: static
Note: @nodiscard - Return value should not be ignored
Dumps a table into a string representation. This is useful for debugging purposes.
Parameters:
  • tbl (table): The table to dump.
  • parents (table<table>?): parent tables
Returns: str The string representation of the table.
generate(format: string): string
Modifier: static
Note: @nodiscard - Return value should not be ignored
Generates a formatted string based on the provided format. a will be replaced with a random lower case letter, and 0 will be replaced with a random digit, and . will be replaced with any uppercase letter or number.
Parameters:
  • format (string): The format for the string. A will be replaced with a random upper case letter,
Returns: formatted The formatted string.
split(str: string, sep: string): table<string>
Modifier: static
Note: @nodiscard - Return value should not be ignored
Splits a string into substrings seperated by the given seperator.
Parameters:
  • str (string): the string to split.
  • sep (string): the separator to use.
Returns: strings the split substrings