Module:String2/sandbox: Difference between revisions

Content deleted Content added
allow wrapper for split
frame.args will not be false, so test explicitly
Line 111:
-- if plain is false/no/0 then separator is treated as a Lua pattern - defaults to plain=true
p.split = function(frame)
local args = frame.args or frame:getParent().args or {}
if not(args[1] or args.txt) then args = frame:getParent().args end
local txt = args[1] or args.txt or ""
if txt == "" then return nil end