In Swift, the first
property is used to return the first character of a string.
string.first
This property returns the first character of a string.
// create stringslet name = "Theodore"let greetings = "Welcome to Edpresso!"// print first characters of strings.print(name.first!)print(greetings.first!)
first
property to get the first characters of the strings. Next, we print the values to the console.