NL
Size: a a a
ВП
ВП
ВП
M
ВП
M
M
M
M
M
IS
let s = "www.xxx.yyy.zzz"
var a = s.split(separator: ".")
if let index = a.firstIndex(of: "yyy") {
a[index] = "qqq"
}
let r = a.joined(separator: ".") // "www.xxx.qqq.zzz"
let s = "www.xxx.yyy.zzz"
let regex = try! NSRegularExpression(pattern: "\\b.yyy.\\b", options: .caseInsensitive)
let range = NSRange(location: 0, length: s.count)
let modString = regex.stringByReplacingMatches(in: s, options: [], range: range, withTemplate: ".qqq.")
yyy
на qqq
IS
"\\b\\.yyy\\.\\b"
A
G