Module:String

From CrawlWiki
Revision as of 16:02, 29 November 2013 by CommanderC (talk | contribs) (Created page with "local p = {} function p.first_word(frame) local text = frame.args[1] for token in string.gmatch(text, "[^%s]+") do return token end end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Small functions for string manipulation.


local p = {}
 
function p.first_word(frame)
  local text = frame.args[1]
  for token in string.gmatch(text, "[^%s]+") do
    return token
  end
end

return p