satellite03
IS-IT--Management
hi i am testing a code
>>java TestProgram
n=this
this is giving me first token "this"....but say i want to get third token ONLY (in this example code it is "a"
...how can i get that??????
in fact i want to extract any desired token from a string...what is the procedure???
Code:
import java.io.*;
import java.util.*;
class TestProgram
{
public static void main(String args[])
{
StringTokenizer st = new StringTokenizer(" this is a test ");
String n = st.nextToken();
System.out.println("n="+n);
}
}
n=this
this is giving me first token "this"....but say i want to get third token ONLY (in this example code it is "a"
in fact i want to extract any desired token from a string...what is the procedure???