mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
New lua function replace
This commit is contained in:
parent
0a09363bba
commit
d71101f10d
1 changed files with 11 additions and 0 deletions
|
|
@ -421,6 +421,17 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function replace(str, o, n)
|
||||
local i, j = string.find(str, o, 1, true)
|
||||
if i then
|
||||
return string.sub(str, 1, i-1) .. n .. string.sub(str, j+1, -1)
|
||||
else
|
||||
return str
|
||||
end
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function formatEpoch(epoch, full_time)
|
||||
return(format_utils.formatEpoch(epoch, full_time))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue