Skip to content

Commit

Permalink
copy the Lua string.interp function into a module StringInterp.lua in…
Browse files Browse the repository at this point in the history
… libs/
  • Loading branch information
johnbartholomew committed May 5, 2012
1 parent 41ffad0 commit fd1378b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/libs/StringInterp.lua
@@ -0,0 +1,4 @@
-- a nice string interpolator
string.interp = function (s, t)
return (s:gsub('(%b{})', function(w) return t[w:sub(2,-2)] or w end))
end

0 comments on commit fd1378b

Please sign in to comment.