How to append a character to a string in Swift
In this tutorial, we are going to learn about how to append any character to a string in Swift.
Appending a character to string
Swift has built-in append()
method by using that we can append a character to a string.
Here is an example, that appends the character o
to a greet
string:
var greet = "Hell"
greet.append("o");
print(greet)
Output:
Hello