|
-
Reconizing Input
for(int i=0; i<userInput.length(); i++){
chemicalCh = userInput.charAt(i);
if(Character.isLowerCase(chemicalCh)){
splittedUserInput+=chemicalCh;
String result = (String) chemicalElement.get(splittedUserInput);
System.out.println(splittedUserInput+ " for " +result);
}
else(!splittedUserInput.equals("")){ chemicalArray.add(splittedUserInput.trim());
splittedUserInput = userInput.substring(i,i+1);
}
}
I use this arguement to make my program figure out how to reconize : XeCa
Xe - Xenon
Ca - Calcium
but it doesn't reconize Single character anymore
so if it is XeCaS
It reconize Xe and Ca but not S?
(I store all the character in Hastable, Xe as primary key and Xenon as secondary key)
Can anyone help?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks