Summary

Functions

Finds every match of a pattern in a string.
Turns a string into an identifier.

Functions

string.FindAll(str, pattern)

shared gamemodes/catwork/gamemode/core/sh_kernel.lua:483

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

Defined in