i have to generate the range of string and get the startLocation of sub string and the last location of sub string. i have converted the swift 2 code into swift 4 and i am getting error.
Value of type 'Range?' (aka 'Optional>') has no member 'location'
so how can i get the location in swift 5?
let innerData = data.subdata(with: innerRange)
let headerRange = innerData.range(of: "\r\n\r\n".data(using: .utf8)!, options: NSData.SearchOptions())
let startLocation = headerRange.location + headerRange.length