Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

check if string contains specified sequence

843785Jan 26 2009 — edited Jan 27 2009
I'd like to check whether some input string is monsyllabic or not. Easiest way to go would be to check if the sequence 'vowel-consonant-vowel' is in the string. Since there of course can be multiple consonants in between, this has to be taken into account.

I could imagine doing this by first specifiying what a vowel and a cons. is, then taking the input string and use some sort of contains method. In the java tutorials the contains method is said to take an object, but how can I make this object this sequence I want to check for?

Anyone any ideas on how to write this in code, or any ideas/suggestions?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2009
Added on Jan 26 2009
5 comments
810 views