diff --git a/Zframework/stringExtend.lua b/Zframework/stringExtend.lua index e3f6c8ba..70907c65 100644 --- a/Zframework/stringExtend.lua +++ b/Zframework/stringExtend.lua @@ -16,6 +16,12 @@ do--function STRING.shiftChar(c) end end +function STRING.trim(str) + if not str:find("%S")then return""end + str=str:sub((str:find("%S"))):reverse() + return str:sub((str:find("%S"))):reverse() +end + function STRING.split(s,sep,regex) local L={} local p1,p2=1--start,target