Instance Methodswift 6.0.1Swift

append(_:)

Appends the given character to the string.

mutating func append(_ c: Character)

Parameters

c

The character to append to the string.

The following example adds an emoji globe to the end of a string.

var globe = "Globe "
globe.append("🌍")
print(globe)
// Prints "Globe 🌍"