Cant seem to figure out how to convert a Token (StringTokenizer) into a String.
I have a String[] of keywords, and I read in multiple lines of text from a text file. StringTokenizer is used to chop the sentence up,,, at which point I need to pass each Token (the String representation of the Token) to a function for word analysis.
Is there a simple way to extract the string value from the token?
Any help appreciated guys....
Great help guys thanks again!!
Use the method nextToken()
to return the token as a string
StringTokenizer st = new StringTokenizer("this is a test");
while (st.hasMoreTokens()) {
wordAnalysis(st.nextToken());//sends string to your function
}