When trying to use the +=
operator to append a Character
to a String
, I'm getting the following error:
String is not identical to UInt8
The error occurs on the puzzleOutput += char
line in the code below:
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)
How can I append a Charater
to a String
?