Modul:Common: Unterschied zwischen den Versionen

Aus FürthWiki

tableConcatNil() + first handling
(tableConcatNil() auch leere Elemente)
(tableConcatNil() + first handling)
Zeile 145: Zeile 145:
if t ~= nil then
if t ~= nil then
s = ""
s = ""
local first = true
-- höchsten Index ermitteln
-- höchsten Index ermitteln
local i_max = 0
local i_max = 0
Zeile 155: Zeile 156:
for i = 1, i_max do
for i = 1, i_max do
if t[i] ~= nil then
if t[i] ~= nil then
if s ~= "" then
if first then
s = s .. (sep or " ")
s = s .. (sep or " ")
first = false
end
end
s = s .. t[i]
s = s .. t[i]