Module:String2: Difference between revisions

Content deleted Content added
store just the string
allow split to use negative indices
Line 115:
local plain = (args[4] or args.plain or "true"):sub(1,1)
plain = (plain ~= "f" and plain ~= "n" and plain ~= "0")
returnlocal splittbl = mw.text.split( txt, sep, plain )[idx]
if idx < 0 then idx = #splittbl + idx + 1 end
return splittbl[idx]
end