Appends the given character to the string.
SDK
- Xcode 10.0+
Framework
- Swift Standard Library
Declaration
mutating func append(_ c: Character)
Parameters
c
The character to append to the string.
Discussion
The following example adds an emoji globe to the end of a string.
var globe = "Globe "
globe.append("🌍")
print(globe)
// Prints "Globe 🌍"