Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to extract the name-value pairs?

 
ludo Lacor
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be very pleased if anyone could tell me how to
extract the name-value pairs for the findCriteria(..) method.
I was trying to do it by hand, but I'm sure there must be some
standard way to do things like this.
Thanks in advance,

Greetings Ludo
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out StringTokenizer class. It basically creates an enumeration of the tokens inside a delimited string.
i.e.:
StringTokenizer st = new StringTokenizer("A=1,B=2,C=3",",")
Whilte (st.hasMoreTokens())
{
System.out.println(st.nextToken())
}
Would give you the following output:
A=1
B=2
C=3

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic