find range of string swift
let string = "Please Click Here"
if let range = string.range(of: "Click") {
print(range)
}
find range of string swift
let string = "Please Click Here"
if let range = string.range(of: "Click") {
print(range)
}
how can i find range of a string in another string swift
let str = "abcde"
if let range = str.range(of: "cd") {
let substring = str[..<range.lowerBound] // or str[str.startIndex..<range.lowerBound]
print(substring) // Prints ab
}
else {
print("String not present")
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us