Appends the given character to the string.
SDK
- Xcode 10.0+
Framework
- Swift Standard Library
Declaration
Parameters
c
The character to append to the string.
Discussion
The following example adds an emoji globe to the end of a string.
Appends the given character to the string.
SDK
Framework
c
The character to append to the string.
The following example adds an emoji globe to the end of a string.
func append(String)
Appends the given string to this string.
func append<S>(contents Of: S)
Appends the characters in the given sequence to the string.
func append<S>(contents Of: S)
Adds the elements of a sequence or collection to the end of this collection.
func reserve Capacity(Int)
Reserves enough space in the string’s underlying storage to store the specified number of ASCII characters.
static func + <Other>(Other, String) -> String
Creates a new collection by concatenating the elements of a sequence and a collection.
static func + <Other>(String, Other) -> String
Creates a new collection by concatenating the elements of a collection and a sequence.
static func + <Other>(String, Other) -> String
Creates a new collection by concatenating the elements of two collections.
static func += <Other>(inout String, Other)
Appends the elements of a sequence to a range-replaceable collection.