hi,
I want to read the string as many time and filter that string, store in hashtable. I don't know any filter command is present in java.here I am sending the code.
import java.util.StringTokenizer;
import java.util.Hashtable;
import java.util.Enumeration;
public class test123 {
public static void main(String[] args) {
String line = "be$whatever$you$can$be";
String key;
Hashtable hash=new Hashtable();
StringTokenizer parser = new StringTokenizer(line,"$");
while (parser.hasMoreTokens()) {
key = parser.nextToken();
System.out.print(key + " ");
System.out.println(hash.put(key,1));
}
System.out.println("Retriving all keys from the Hashtable");
Enumeration e = hash.keys();
while( e. hasMoreElements() ){
System.out.println( e.nextElement() );
// break;
}
}
}