To append a character to the beginning of a string in Swift, you can use string interpolation or the `+` operator.
In this example,
str1
with a value of "ello"
.'H'
to str1
.var str1 = "ello"
str1 = "H" + str1
print(str1)
Hello
In this example,
str2
with a value of "orld"
.'W'
to str2
.var str2 = "orld"
str2 = "W\(str2)"
print(str2)
World
In this tutorial, we learned How to Append a Character to beginning of a String in Swift language with well detailed examples.