Version 1 (modified by javier_guerra, 15 years ago) (diff)

--

stringutils.lua

This module adds some extra functions to the standard Lua string library. These can also be used as 'string methods', both valid syntaxes are shown here.

string.split (s, delimiter)
s:split (delimiter)

Returns an array of substrings, separated by the pattern delimiter.

string.template (s, variables)
s:template (variables)

Returns a formatted string, replacing any %{key}% by the value of variables.key.