Files
knorke/helpers.lua

11 lines
289 B
Lua
Raw Normal View History

-- helper functions
2016-02-15 21:13:41 +01:00
local helpers = {}
-- substitutes parts from format_string of the form ${var} with the value from sub_table with the key "var"
function helpers.sub_format_string(format_string, sub_table)
return string.gsub(format_string, "%${(%w+)}", sub_table)
2016-02-15 21:13:41 +01:00
end
return helpers