Modul:String: Unterschied zwischen den Versionen

+ appendWithComma(s, a)
(+ appendWithKomma(s, a))
(+ appendWithComma(s, a))
 
Zeile 120: Zeile 120:
end
end


function p.addKomma(s)
function p.appendWithComma(s, a)
-- fügt Komma und Leerzeichen hinzu, falls sich im String bereits etwas befindet
if s ~= "" then
s = s .. ", "
end
return s
end
 
function p.appendWithKomma(s, a)
if a ~= nil and a ~= "" then
if a ~= nil and a ~= "" then
s = p.addKomma(s) .. a
if s ~= "" then
s = s .. ", " .. a
else
s = a
end
end
end
return s
return s