I have a dictionary like this
["Price": ["$00.00 - $200.00", "$200.00 - $400.00", "$600.00 - $800.00"]]
Now I am storing all the dictionary value in array like this
var priceRange: [String] = [String]()
if let obj = currentFilters["Price"] as? [String] {
self.priceRange = obj
printD(self.priceRange)
}
And by the use of Array.first and Array.last method I will get the values of first element and last element of my array.
let first = priceRange.first ?? "" // will get("[$00.00 - $200.00]")
let last = priceRange.last ?? "" // will get("[$600.00 - $800.00]")
But What I actually want is I want the $00.00 from first and $800 from last to make the desired combination of [$00.00 - $800.00].
How can I do this. Please help?