Editing Module:Array
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 40: | Line 40: | ||
-- split string to array | -- split string to array | ||
local array = lib.split(arrayString, separator, split_opt) | local array = lib.split(arrayString, separator, split_opt) | ||
-- remove duplcates from array | -- remove duplcates from array | ||
| Line 65: | Line 54: | ||
for key, value in pairs(array) do | for key, value in pairs(array) do | ||
local item = form | local item = form | ||
item = item:gsub('{newline}', '\n') | item = item:gsub('{newline}', '\n') | ||
item = item:gsub('{index}', key) | item = item:gsub('{index}', key) | ||
| Line 90: | Line 72: | ||
split(values, '2') | split(values, '2') | ||
item = item:gsub('{item}', value) | item = item:gsub('{item}', value) | ||
item = item:gsub('{item([%d%.]*)}', | item = item:gsub('{item([%d%.]*)}', | ||