Check out example codes for "find range of string swift". It will help you in understanding the concepts better.

Code Example 1

let string = "Please Click Here"
if let range = string.range(of: "Click") {
   print(range)

}

Learn ReactJs, React Native from akashmittal.com