Let\'s say I want to split a string by an empty space. This code snippet works fine in Swift 1.x. It does not work in Swift 2 in Xcode 7 Beta 1.
var str = \"
In Swift 3 componentsSeparatedByString and split is used this way.
componentsSeparatedByString
split
let splitArray = "Hello World".components(separatedBy: " ") // ["Hello", "World"]
let splitArray = "Hello World".characters.split(separator: " ").map(String.init) // ["Hello", "World"]