May 2017
Intermediate to advanced
416 pages
21h 33m
English
Although there is no built-in function for splitting and joining strings, the NSE library stdnse can take care of that:
stdnse.strjoin(delimeter, list) stdnse.strsplit(pattern, text)
Look at the following example:
local stdnse = require “stdnse” … Local csv_str = “a@test.com,b@foo.com,c@nmap.org” local csv_to_emails = stdnse.strsplit(“,”, emails) for email in pairs(csv_to_emails) do print(email) end
The output will be as follows:
a@test.com b@foo.com c@nmap.org
Read now
Unlock full access