create util

This commit is contained in:
Michael Chris Lopez
2021-09-21 16:47:35 +08:00
parent 15d468083b
commit 58060aaf73
2 changed files with 12 additions and 7 deletions

10
lua/zenbones/util.lua Normal file
View File

@@ -0,0 +1,10 @@
local M = {}
-- got from http://lua-users.org/wiki/StringInterpolation
function M.interp(s, tab)
return (s:gsub("($%b{})", function(w)
return tab[w:sub(3, -2)] or w
end))
end
return M