Removing the first character from a string in Swift
In this tutorial, we are going to learn about how to remove the first character from a string in Swift.
Removing the first character
To remove the first character from a string , we can use the built-in removeFirst()
method in Swift.
Here is an example, that removes the first character m
from the color
string.
var color = "myellow"
color.removeFirst()
print(myString)
Output:
yellow