Question Locked

help me...

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
how to read word by word from a text file using java?

4 replies

by tony hopkinson

Regular expressions has a built in function called split. Essentially you puull in the content of a text file and split on space, you end up with an array of strings that were delimited by spaces.
You'll probably have to deal with punctuation and control characters (tabs) for instance as well.

Google for java split
Lots of examples

by Former member

Scanner in = new Scanner();
in = in.next();

learn man, learn.

by kkkarthick_7

hello man use stream to read a text file on that u can read by
in.read();
in.readstring();

like that you can find so many methods to read a word deponds on the stream its vary

This discussion is closed to new replies.