Module:TableGenerator: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m removed if i>1 |
mNo edit summary |
||
| Line 47: | Line 47: | ||
return result | return result | ||
end | |||
--Used for converting a list to a parameter list without resorting to string parser functions | |||
--{{#invoke:TableGenerator|replaceCommasWithPipes|Your,string,with,commas}} | |||
--outputs | |||
--Your|string|with|commas | |||
function p.replaceCommasWithPipes(frame) | |||
-- Get the input string from the template arguments | |||
local inputString = frame.args[1] or "" | |||
-- Replace all commas with pipes | |||
local outputString = inputString:gsub(",", "|") | |||
return outputString | |||
end | end | ||
return p | return p | ||