Add a simple trim to lua
This commit is contained in:
@@ -179,6 +179,7 @@ function ceil(x) return math.ceil(x) end
|
|||||||
function upper(s) return string.upper(s) end
|
function upper(s) return string.upper(s) end
|
||||||
function lower(s) return string.lower(s) end
|
function lower(s) return string.lower(s) end
|
||||||
function format(s, ...) return string.format(s, ...) end
|
function format(s, ...) return string.format(s, ...) end
|
||||||
|
function trim(s) return string.gsub(s, "^%s*(.-)%s*$", "%1") end
|
||||||
|
|
||||||
-- String split helper
|
-- String split helper
|
||||||
function strsplit(inputstr, sep)
|
function strsplit(inputstr, sep)
|
||||||
|
Reference in New Issue
Block a user