5e8e495c56 2024-01-30 1: function string:lstrip()
5e8e495c56 2024-01-30 2: return self:gsub("^%s+", "")
5e8e495c56 2024-01-30 3: end
5e8e495c56 2024-01-30 4: function string:rstrip()
5e8e495c56 2024-01-30 5: return self:gsub("%s+$", "")
5e8e495c56 2024-01-30 6: end
5e8e495c56 2024-01-30 7: function string:strip()
89f423ff38 2024-02-13 8: local h1
89f423ff38 2024-02-13 9: h1 = self:lstrip()
89f423ff38 2024-02-13 10: return h1:rstrip()
5e8e495c56 2024-01-30 11: end
5e8e495c56 2024-01-30 12: function string:startswith(text)
5e8e495c56 2024-01-30 13: if self:sub(1, #text) == text then
5e8e495c56 2024-01-30 14: return self
5e8e495c56 2024-01-30 15: end
5e8e495c56 2024-01-30 16: end
5e8e495c56 2024-01-30 17: function string:endswith(text)
5e8e495c56 2024-01-30 18: if self:sub(-#text) == text then
5e8e495c56 2024-01-30 19: return self
5e8e495c56 2024-01-30 20: end
5e8e495c56 2024-01-30 21: end