Skip to content

Commit

Permalink
Update string.lua, adding trim
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi authored Dec 30, 2024
1 parent 5306296 commit d89663e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/down/util/string.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@ function string.isbool(self)
return nil
end

--- @param self string self
--- @return string
function string:trim(self)
return self:gsub("^%s*(.-)%s*$", "%1")
end

return string

0 comments on commit d89663e

Please sign in to comment.