替换子串

基本类型 / 字符串

var startString = "3, 2, 1, go!"
startString = startString
    .replacing("1", with: "one") 
    .replacing("2", with: "two")
    .replacing("3", with: "three")
//startString = "three, two, one, go!"

print("startString is '\(startString)'")