mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Add string.contains plain parameter
This commit is contained in:
parent
45c1128d16
commit
51912e7309
1 changed files with 3 additions and 2 deletions
|
|
@ -12,12 +12,13 @@ locales_utils = require "locales_utils"
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function string.contains(String,Start)
|
||||
-- Note: Regexs are applied by default. Pass plain=true to disable them.
|
||||
function string.contains(String,Start,plain)
|
||||
if type(String) ~= 'string' or type(Start) ~= 'string' then
|
||||
return false
|
||||
end
|
||||
|
||||
local i,j = string.find(String, Start, 1)
|
||||
local i,j = string.find(String, Start, 1, plain)
|
||||
|
||||
return(i ~= nil)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue