let string = "Please Click Here"
if let range = string.range(of: "Click") {
print(range)
}
转换为NSString
和userrangeOf
:
let string = "Please Click Here"
let range = (string as NSString).range(of: "Click", options: .caseInsensitive)
print(range)