generate functionWed, 30 Nov 2022

find if the given string has the letter "e" in it, and output an alert if so

func hasLetter(str: String) { for letter in str.characters { if letter == "e" { print("This string has an e!") } } } hasLetter(str: "hello") // This string has an e!

Questions about programming?Chat with your personal AI assistant