mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
Update On Thu Jan 1 19:42:29 CET 2026
This commit is contained in:
@@ -243,9 +243,9 @@ function url(...)
|
||||
end
|
||||
|
||||
function trim(s)
|
||||
local len = #s
|
||||
local i, j = 1, len
|
||||
while i <= len and s:byte(i) <= 32 do i = i + 1 end
|
||||
if type(s) ~= "string" then return "" end
|
||||
local i, j = 1, #s
|
||||
while i <= j and s:byte(i) <= 32 do i = i + 1 end
|
||||
while j >= i and s:byte(j) <= 32 do j = j - 1 end
|
||||
if i > j then return "" end
|
||||
return s:sub(i, j)
|
||||
|
||||
Reference in New Issue
Block a user