跳到内容

模块:String:修订间差异

添加369字节 、​ 2020年3月1日 (星期日)
小
导入1个版本
小 (导入13个版本:cquote)
小 (导入1个版本)
 
(未显示另一用户的1个中间版本)
第472行: 第472行:
end
end
return result;
return result;
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
end