Public sandbox/Sjehenjcr

varNames = {} varDatas = {}

function replace(str,from,to) local replaced = string.gsub(str,from,to) return replaced end

function addVar(name,data) table.insert(varNames,name) table.insert(varDatas,data) end

function formatText(toformat) local doing = toformat for i in pairs(varNames) do   doing = replace(doing,"{" .. varNames[i] .. "}",varDatas[i]) end return doing end

addVar("haha","OMG") print(formatText("hello{haha}"))