Files
Endfield-Data/LuaScripts/Common/Utils/FormatUtils.lua
2025-12-02 20:37:18 +07:00

21 lines
316 B
Lua

local FormatUtils = {}
function FormatUtils.replaceVars(str, vars)
if not vars then
vars = str
str = vars[1]
end
return (string.gsub(str, "({([^}]+)})",
function(whole,i)
return vars[i] or whole
end))
end
_G.FormatUtils = FormatUtils
return FormatUtils