Skip to content

Commit 8926832

Browse files
committed
feat(utils): string.trim
1 parent 75065c6 commit 8926832

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugin_files/bin/scripting/utils.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,10 @@ string.split = function(str, split)
127127
table.insert(splitted, split)
128128
end
129129
return splitted
130+
end
131+
132+
--- @param str string
133+
--- @return string
134+
string.trim = function(str)
135+
return (str:gsub("^%s*(.-)%s*$", "%1"))
130136
end

0 commit comments

Comments
 (0)