Modul:Biographie/RemoveDuplicates
Ausgesinn
| Dokumentatioun vum Modul:Biographie/RemoveDuplicates | [liesen] [änneren] [Versioune weisen] |
D'Dokumentatioun fir dëst Modul steet hei ënnendrënner an ass vun der Säit Modul:Biographie/RemoveDuplicates/doc hei agebonne ginn. All Froe sollen och op där hirer Diskussiounssäit gestallt ginn. Kuckt och: Hëllef:Moduler.
local p = {}
function p.removeDuplicates(frame)
local items = frame.args[1] or ''
local seen = {}
local output = {}
-- Split the input using ", " as the separator
for item in mw.text.gsplit(items, ", ", true) do
item = mw.text.trim(item) -- Trim whitespace
if not seen[item] then
seen[item] = true
table.insert(output, item)
end
end
-- Return the cleaned list, joined back with ", "
return table.concat(output, ", ")
end
return p
