JAVA: Problem with multiple or statements

Status
Not open for further replies.

Execalm

Smack-Fu Master, in training
88
Subscriptor++
I'm trying to write a program that compares a string with a bunch of vowels. I know how to use the basic operators to compare one character from the string to one vowel:

if (string=="a")

but I'm too lazy to write a bunch of cascading if-then statements to compare the string with all the vowels. I tried using:

if (string=="a"||"A"||"e"||"E".......etc.)

but I get an error message saying I can't convert char to boolean.

Is there away to do all of this in one if statement? Thanks!
 
Status
Not open for further replies.