使用+ =将字符附加到字符串时出错:字符串与UInt8不同

gur*_*i23 3 swift ios8

当尝试使用+=运算符追加a CharacterString,我收到以下错误:

字符串与UInt8不同

错误发生在puzzleOutput += char下面代码中的行上:

let puzzleInput = "great minds think alike "
var puzzleOutput = ""

for char in puzzleInput
{
    switch char
    {
    case "a","e","i","o","u":
        continue

    default:
       puzzleOutput += char
    }
}

println(puzzleOutput)
Run Code Online (Sandbox Code Playgroud)

我怎样才能追加CharaterString

小智 6

使用+ =将字符附加到字符串是故意删除几个以前的语言.使用

puzzleOutput.append(炭)

代替.