Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

converting text from a file into a string

  Asked By: Steven    Date: May 15    Category: Java    Views: 2148
  

I have seen several ways to read text from a file and convert it
into a string but I would like to know the best way to do this. I
have seen FileInputStreams, FileReaders, and use of a buffered
reader. I wanted to know the easiest way to do this.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Wilfred Young     Answered On: May 15

String s=""; // string  = "" by default, but i just fell better
initalising

while ( ... )
{
s = s + read  string
}


 
Didn't find what you were looking for? Find more on converting text from a file into a string Or get search suggestion and latest updates.




Tagged: