swift - How to check if string contains a certain character? -
i've been trying find can't. have code:
func ayylmao(vorno: string){ if (vorno.(whatever function finding string goes here)("a", "e", "i", "o", "u")) { print("input includes vowels") } }
but right @ if
statement can't find check if characters in string.
like this:
let s = "hello" let ok = s.characters.contains {"aeiou".characters.contains($0)} // true
Comments
Post a Comment