Question

Locked

help me...

By saruna_psg ·
how to read word by word from a text file using java?

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Regex

by Tony Hopkinson In reply to help me...

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

Collapse -

It is called learning

by normhaga In reply to help me...

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

learn man, learn.

Collapse -

use Streams

by kkkarthick_7 In reply to It is called learning

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

Back to Software Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums