Replace string in string

 Problem

I have a string and want to replace all occurrences of a substring with another string.



 Recipe


// String literal
let s = "Hello World"

// Replace "World" with "Guys"

let b = s.stringByReplacingOccurrencesOfString("World", withString:"Guys")
print(b)
				


 Playground