mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 07:13:45 +01:00
text: Minor cleanup
This commit is contained in:
parent
ed3ab9c403
commit
530360474a
6
text.lua
6
text.lua
@ -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 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)
|
function trim(text, to_remove)
|
||||||
local j = 1
|
local j = 1
|
||||||
@ -188,4 +188,4 @@ function is_identifier(text)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Export environment
|
-- Export environment
|
||||||
return _ENV
|
return _ENV
|
||||||
|
Loading…
Reference in New Issue
Block a user