string library
Summary
Functions
FindAll(str, pattern)shared
Finds every match of a pattern in a string.
MakeID(str)shared
Turns a string into an identifier.
Functions
Finds every match of a pattern in a string.
Each hit is a list of { match, startPos, endPos }. Returns nil when either argument is
missing.
Parameters
- str String The string to search
- pattern String Lua pattern to look for
Returns
- List<List> The hits in order
Turns a string into an identifier.
Lowercases it (UTF-8 aware), replaces spaces with underscores and strips quotes, slashes and
the characters ^ : . ; & , %.
string.MakeID('Civil Protection') -- 'civil_protection'
Parameters
- str String Text to convert
Returns
- String The identifier