The append() method adds a string value to another existing string.
Example
append() Syntax
The syntax of the string append() method is:
string.append(str: String)
Here, string is an object of the String class.
append() Parameters
The append() method takes a single parameter.
- str - string to be joined to string
append() Return Value
- returns the appended string.
Example: Swift string append()
Using + Operator to Append
In Swift, we can also use the + operator to append two strings. For example,