Module:String
From HorizonXI Wiki
Documentation for this module may be created at Module:String/doc
--[[
A module for general string functions.
]]
local str = {}
--[[
join
Using the first argument as a separator, join the remaining arguments together.
Example:
{{#invoke:String|join|,|apples|bananas|cherries}}
]]
function str.join(frame)
local separator = frame.args[1]
local parts = {}
for k, v in ipairs(frame.args) do
if k > 1 then
table.insert(parts, v)
end
end
return table.concat(parts, separator)
end
