nextToken « StringTokenizer « Java Data Type Q&A





1. How does the java " stringtokenizer.nextToken(delimiter); " work?    stackoverflow.com

What i mean is what string values are accepted as delimiters? this is because i keep trying to use a string composed of several different characters but the program just seems to ...

2. StringTokenizer, countTokens, nextToken???    coderanch.com

I am trying to write an application which will read data.txt file and and report all words that have 5 or more letters. Where am I going wrong? Thanks in Advance. import java.io.*; import java.util.*; public class BigWords { public static void main(String args[]) throws IOException { int letterCount; FileReader fr = new FileReader("E:\\My Documents\\OCC\\JavaII\\FileDemo1\\data.txt"); BufferedReader br = new BufferedReader(fr); String ...

3. Difference between split() and StringTokenizer s nextToken()    coderanch.com

Hi All, I have the following program, The string "x" is a tab separated 12s34; public class Testoken { public static void main(String[] args) { String x = "1 2 s 3 4 "; StringTokenizer st = new StringTokenizer(x,"\t"); int i = 0; while(st.hasMoreTokens()){ System.out.println("token-->"+st.nextToken()); i++; } System.out.println("i-->"+i);//elements from tokenizer String [] a = x.split("\t"); System.out.println("length--->"+a.length); for(int y = 0;y"+a[y]);//elements ...