text: Minor cleanup

master
Lars Mueller 2022-07-05 11:34:58 +02:00
parent ed3ab9c403
commit 530360474a
1 changed files with 3 additions and 3 deletions

View File

@ -9,9 +9,9 @@ function upper_first(text) return text:sub(1, 1):upper() .. text:sub(2) end
function lower_first(text) return text:sub(1, 1):lower() .. text:sub(2) end
function starts_with(text, start) return text:sub(1, start:len()) == start end
function starts_with(text, prefix) return text:sub(1, #prefix) == prefix end
function ends_with(text, suffix) return text:sub(text:len() - suffix:len() + 1) == suffix end
function ends_with(text, suffix) return text:sub(-#suffix) == suffix end
function trim(text, to_remove)
local j = 1
@ -188,4 +188,4 @@ function is_identifier(text)
end
-- Export environment
return _ENV
return _ENV