deepak kumar deepak kumar - 1 year ago 71
iOS Question

How to get data from string after particular backslash?

I have a string such as

. Now I want to get data from uplaod onwards. Please suggest any function or code?

Answer Source

If path of image is not fixed or order of uplaod is not specific try like this.

let string = "\\home\\var\\path\\uplaod\\abc.png"
if let range = string.range(of: "uplaod") {
    let imagePath = string.substring(from: range.lowerBound)


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download