Split a string by another string

 Problem

I have a String and I want to split it, by using another string, into an array of sub-strings.



 Recipe


// String literals
let s = "Hello World"

// Split it by "o"
var a = s.componentsSeparatedByString("o")
print(a)
				


 Playground