mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
add rtrim function to ignore final space character (#4638)
This commit is contained in:
parent
9d282f8305
commit
7a8e0cf53f
2 changed files with 13 additions and 3 deletions
|
|
@ -3946,6 +3946,13 @@ end
|
|||
function table.has_key(table, key)
|
||||
return table[key] ~= nil
|
||||
end
|
||||
-- ###########################################
|
||||
|
||||
function string.rtrim(s)
|
||||
local n = #s
|
||||
while n > 0 and s:find("^%s", n) do n = n - 1 end
|
||||
return s:sub(1, n)
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue