I want to split an array like shown below.
let arrayToSplit = [\"Europe|#|France|#|Paris\", \"Europe|#|Italy|#|Rome\", \"America|#|USA|#|Washington\", \"America|
let arrayToSplit = ["Europe|#|France|#|Paris", "Europe|#|Italy|#|Rome", "America|#|USA|#|Washington", "America|#|Canada|#|Ottawa"]
let arrayOfLists = arrayToSplit.map{
$0.componentsSeparatedByString("|#|")
}
let columns = Array(0..<3).map{ i in
arrayOfLists.map{ list in list[i]}
}
print(columns)
//[["Europe", "Europe", "America", "America"], ["France", "Italy", "USA", "Canada"], ["Paris", "Rome", "Washington", "Ottawa"]]