There is a string from server as:
"Please review the work schedule for personnel associated with this device\nhttps://test.abcdxyz.com/media?q=kp97k73a9omm"
I need to extract the url from this string that is :
"https://test.abcdxyz.com/media?q=kp97k73a9omm"
How can I do this in swift 4 ??
What I found after reading about String is :
if msg.contains("https://") {
let x = msg.range(of: "https://")?.lowerBound
let str = msg.substring(from: x!)
print(str)
}
NSDataDetecter is also a cool solution for this. Which one is more reliable in this case ??