Module:Dash: Difference between revisions

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
No edit summary
Line 2: Line 2:


function p.dashes(input_str, spaces, separator)
function p.dashes(input_str, spaces, separator)
words = {}
return tostring(input_str):gsub("%s+", spaces .. separator .. spaces)
local output = ""
    for wd in tostring(input_str):gmatch("%s+") do
    table.insert(words, wd)
end
for i, v in pairs(words) do
output = output .. words[i]
if next(v, i) ~= nil then
    output = output .. spaces .. separator .. spaces
end
end
return output
end
end


return p
return p