Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

criteriaFind and single quotes

 
Reinhold Gruber
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I read a couple of threads about the criteriaFind()-Method. It seems that almost everybody used StringTokenizer to parse and split the criteria-String like that

But the criteriaString could be something like
origin='SFO, USA',destination='DEN' and countTokens() would return 5.
Is there a better way of parsing the criteria-String?
Reinhold
 
Junilu Lacar
Marshal
Posts: 10387
123
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reinhold,
Apparently, it is OK to use JDK1.4 for the current exam (see this thread), so you might want to look into using regular expressions (see the java.util.regex package in 1.4).
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!