82.367
Bearbeitungen
(fix p.shallowcopy) |
Keine Bearbeitungszusammenfassung |
||
| Zeile 103: | Zeile 103: | ||
function rtrim(s) | function rtrim(s) | ||
-- Removes all spaces at the end of a string | |||
return s:gsub("%s+$", "") | return s:gsub("%s+$", "") | ||
end | end | ||
function ltrim(s) | function ltrim(s) | ||
-- Removes all spaces at the start of a string | |||
return s:match("^%s*(.-)$") | return s:match("^%s*(.-)$") | ||
end | |||
function strip(s) | |||
-- Removes all spaces at the start and at the end of a string | |||
return s:match("^%s*(.-)%s*$") | |||
end | end | ||