Here’s my method:
public char[] ReturnAllVowels(String word)
{
for (int i = 0; i < word.length(); i++)
{
if (word.contains("a" || "e" || "i" || "o" || "u"))
{
}
}
}
It says that || cannot be applied to String class. How can I do this then?
1 Answer