How to append a character to a string in Swift?

Update for the moving target that is Swift:

Swift no longer has a + operator that can take a String and an array of characters. (There is a string method appendContentsOf() that can be used for this purpose).

The best way of doing this now is Martin R’s answer in a comment below:

var newStr:String = str + String(aCharacter)

Original answer:
This changed in Beta 6. Check the release notes.I’m still downloading it, but try using:

var newStr:String = str + [aCharacter]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)