Hello,
Does anyone know how to translate these few lines of Swift into xojo language?
let data = runCMD(app: "/usr/sbin/netstat", args: ["-rnt"]) //shell.execute("/usr/sbin/netstat -rnt")
for line in data.split(separator: "\n") {
if line.split(separator: " ").count > 3 {
let linedata = String(line)
let regex = try! NSRegularExpression(pattern: " +", options: NSRegularExpression.Options.caseInsensitive)
let range = NSRange(location: 0, length: linedata.count)
let normalized = regex.stringByReplacingMatches(in: linedata, options: [], range: range, withTemplate: "\t")
let info = normalized.split(separator: "\t")
if info[0] == "default", info[1].contains("link#") {
return true
}
}
return false
}
Thanks