Jump to content

Module:US elections imagemap/utils

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Elli (talk | contribs) at 04:12, 19 January 2021 (Created page with 'local p = {} function p.split(str, sep) -- split string by separator and return table sep = sep or "%s" local parts = {} for word in str:gmatch("[^" .. se...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function p.split(str, sep) -- split string by separator and return table
  sep = sep or "%s"
  local parts = {}
  for word in str:gmatch("[^" .. sep .. "]+") do parts[#parts+1] = word end
  return parts
end

return p