• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to ignore separators??  RSS feed

 
Ranet Saed
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi plz if i have a text file file1.txt contains for example:
Hi Bob ?
How are You?
I need to meet u.
See u Bye

and i need to copy this file contents to another file but without line separator i need to ignore it so i want for example this file to contain:
Hi Bob ?How are You?I need to meet u.See u Bye
how can i do that???
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just have like...

Scanner scan = new Scanner("filename");
answer += scan.nextLine();


then copy aswer to the new file.

-Justin-
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!