Modul:Common: Unterschied zwischen den Versionen

keine Bearbeitungszusammenfassung
(Änderung 732790 von Stiefelknecht (Diskussion) rückgängig gemacht.)
Markierung: Rückgängigmachung
Keine Bearbeitungszusammenfassung
Zeile 113: Zeile 113:


function contains(list, str)
function contains(list, str)
-- Obsolet
for i, v in ipairs(list) do
for i, v in ipairs(list) do
if v == str then
if v == str then
Zeile 133: Zeile 134:


function rtrim(s)
function rtrim(s)
-- Obsolet
-- Removes all spaces at the end of a string
-- Removes all spaces at the end of a string
return s:gsub("%s+$", "")
return s:gsub("%s+$", "")
Zeile 138: Zeile 140:


function ltrim(s)
function ltrim(s)
-- Obsolet
-- Removes all spaces at the start of a string
-- Removes all spaces at the start of a string
return s:match("^%s*(.-)$")
return s:match("^%s*(.-)$")
Zeile 143: Zeile 146:


function strip(s)
function strip(s)
-- Obsolet
-- Removes all spaces at the start and at the end of a string
-- Removes all spaces at the start and at the end of a string
     return s:match("^%s*(.-)%s*$")
     return s:match("^%s*(.-)%s*$")
Zeile 172: Zeile 176:


function split(s, d)
function split(s, d)
-- Obsolet
if d == nil then d = "%s" end
if d == nil then d = "%s" end
local arr = {}
local arr = {}
82.367

Bearbeitungen