Technology Network Community
Oracle Database
Fusion Middleware
Development Tools
Server & Storage Systems
Enterprise Management
Berkeley DB Family
Cloud Computing
Big Data
Business Intelligence
Migration and Modernization
E-Business Suite
PeopleSoft Enterprise
JD Edwards World
JD Edwards EnterpriseOne
User Productivity Kit Pro (UPK) and Tutor
Governance, Risk & Compliance (GRC)
Master Data Management (MDM)
Oracle CRM On Demand
On Demand: SaaS and Managed Applications
AutoVue Enterprise Visualization
Agile PLM
Endeca Experience Management
Fusion Applications
Archived Forums



New To Java

Quick question

Hi all,           I can't seem to find out how to compare 1 char to 5 chars all at once. What I have at the moment is:                                                           if(token.charAt(x)!='a') 				{ 					nonVowel.append(token.charAt(x)); 			    } 			    else if(token.charAt(x)!='e') 				{ 					nonVowel.append(token.charAt(x)); 				} 			    else if(token.charAt(x)!='i') 				{ 					nonVowel.append(token.charAt(x)); 				} 			    else if(token.charAt(x)!='o') 				{ 					nonVowel.append(token.charAt(x)); 				} 			    else if(token.charAt(x)!='u') 				{ 					nonVowel.append(token.charAt(x)); 				}  But that isn't working and is a little long winded. What I'm looking for is somewhere along the lines of: if(token.charAt(x)!='a'||'e'||'i'||'o'||'u')   That doesn't work either. Any help is much appreciated.

char c = token.charAt(x); // quit calling this method multiple times if ((c != 'a') && (c != 'e') && ...) ...

Something like this?public boolean isVowel(char c) {    return "aeiou".indexOf(c) >= 0; }  kind regards,  Jos

Thanks lads, saved me alot of time.

Related Links

problem with addActionListener()
speech redirection from one app to other; changing input from mic to socket
how to choose NIC that connect to Internet
Getting my head around DocumentListener and how inner classes work
Null Pointer Exception -- what am I doing wrong?
running in any pc
View then modify content of xml file.
NetBeans stopped generating code
Besides throwing exceptions and the "return;" statement
Adding content from a database
which is the best practise?
A simple question about class~(I m rookie)
loading an array using math.random
need help with arrays