| Author |
Retrieve delimetted value from String
|
aakash bhatt
Ranch Hand
Joined: Jan 09, 2003
Posts: 182
|
|
In my String , I have value as String vTest = "ABC#XYZ#PQR#STV" How do i retrieve the value ABC, XYZ each by each which is delimetted by # Thanks, aakash
|
 |
Nigel Browne
Ranch Hand
Joined: May 15, 2001
Posts: 673
|
|
|
Use StringTokenizer
|
 |
Jeff Allison
Greenhorn
Joined: Dec 09, 2004
Posts: 20
|
|
|
While StringTokenizer will work, the split method works for simple strings and delimiters like this. See <http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#split(java.lang.String)>
|
 |
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
|
|
|
And in JDK 5 you can try Scanner. So many ways to solve one problem!
|
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
|
 |
 |
|
|
subject: Retrieve delimetted value from String
|
|
|