You can split a string
var fruitsStr = "apple,orange,pineapple,durian" var fruits = fruitsStr.componentsSeparatedByString(",") for fruit in fruits { print(fruit)/*from w w w . j av a 2s. c om*/ }
Here, the code extracts the string to an array of items separated by the comma ','.