• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java: Dividing up lines from a string  RSS feed

 
Vincent Mule
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So a program takes text from an input file.
A recent study has shown that even when words are jumbled we can read them
as long as the two letters at the front and back are kept in place.
This finding indicates that people have hardwired pattern recognition built into our brains.



How do I take each line of this input and make its own array?

Like
line1[2] = recent
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the String.split() method.
 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that both BufferedReader and Scanner usually read one line at a time, so you can split that text into a String[][], ie an aarry of Stnigrs. With or whouitt spllenig eorrrs.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!