mirror of
https://github.com/mistricky/codesnap.nvim.git
synced 2025-01-03 15:37:29 -08:00
15 lines
288 B
Lua
15 lines
288 B
Lua
local string_util = {}
|
|
|
|
function string_util.trim(str)
|
|
return str:gsub("%s+", "")
|
|
end
|
|
|
|
function string_util.escape(str)
|
|
return str:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1")
|
|
end
|
|
|
|
function string_util.ends_with(str, suffix)
|
|
return str:sub(-#suffix) == suffix
|
|
end
|
|
|
|
return string_util
|