Module CorsixTH.CorsixTH.Lua.string_extensions

Custom format function for our proxy strings.

Keywords for replacing are: %s, %d, %%, %[num]% and %[num]:[tab]% NB: %s and %d are only replaced if none of the new keywords (%[num]% and %[num]:[tab]%) are present. NB: Always escape percent sign (i.e. use %% instead of %) in strings with formatting keywords! Failure to do so can cause unwanted behavior.

Keywords: %s, %d : replaced with the n-th parameter, if the type matches (%s = string, %d = number). %% : replaced by single percent sign "%". Needed for escaping. %[num]% : ([num] between 1-9) replaced by [num]-th parameter. %[num]:[tab]% : replaced by string obtained by indexing string table _S.[tab] with [num]-th parameter.

Functions

TH.stringProxy.find (str, ...) Wrapper for the lua string.find function.
TH.stringProxy.sub (str, ...) Wrapper for the lua string.sub function.


Functions

TH.stringProxy.find (str, ...)
Wrapper for the lua string.find function. Make sure to call mystring:find(...) instead of string.find(mystring, ...).

Parameters:

  • str
  • ...
TH.stringProxy.sub (str, ...)
Wrapper for the lua string.sub function. Make sure to call mystring:sub(...) instead of string.sub(mystring, ...).

Parameters:

  • str
  • ...
generated by LDoc TESTING Last updated 2015-01-01 12:00:00