string module
Core framework Console Desktop
Function | Description | Return value |
---|---|---|
string.len() | Get the string length in bytes | number |
string.byte() | Gets the bytes of a string | numbers |
string.char() | Get a string from successive bytes | string |
string.reverse() | Get a new reversed string | string |
string.sub() | Get a substring | string |
string.gsub() | Get a new string after a global pattern substitution | string |
string.match() | Get a match from a pattern | string | nil |
string.gmatch() | Get a pattern matching iterator | function |
string.find() | Search for the first pattern in a string | number |
string.split() | Split a string into substrings | table |
string.upper() | Convert a string to uppercase | string |
string.lower() | Convert a string to lowercase | string |
string.capitalize() | Capitalize a string | string |
string.normalize() | Removes diacratics from a string | string |
string.similarity() | Compute string similarity using Levenshtein distance algorithm | number |
string.pack() | Serialize values to a string | string |
string.unpack() | Get values from a serialized string | ... |
string.packsize() | Get the size of a serialized string | number |
string.rep() | Concatenate a string multiple times | string |
string.format() | Format a string with multiple values | string |
string.dump() | Get the bytecode of a function | string |
Function | Description | Return value |
---|---|---|
string.ulen() | Get an UTF8 string length in characters | number |
string.ubyte() | Gets the bytes of an UTF8 string | numbers |
string.uchar() | Get an UTF8 string from successive bytes | string |
string.ureverse() | Get a new reversed UTF8 string | string |
string.usub() | Get a substring in a UTF8 string | string |
string.gusub() | Get a new UTF8 string after a global pattern substitution | string |
string.umatch() | Get an UTF8 string match from a pattern | string | nil |
string.gumatch() | Get an UTF8 pattern matching iterator | function |
string.ufind() | Search for the first pattern in an UFT8 string | number |
string.usearch() | Fast UTF8 string search without patterns | number |
string.split() | Split an UTF8 string into substrings | table |
string.upper() | Convert an UTF8 string to uppercase | string |
string.lower() | Convert an UTF8 string to lowercase | string |
string.capitalize() | Capitalize an UTF8 string | string |
string.normalize() | Removes diacratics from a string | string |
string.similarity() | Compute UTF8 string similarity using Levenshtein distance algorithm | number |
string.rep() | Concatenate an UTF8 string multiple times | string |
string.format() | Format an UTF8 string with multiple values | string |
Operation | Description |
---|---|
string iteration | Iterate over an UTF8 string, character by character |
# string length operator | Get the size of the string in bytes |