Results 1 to 2 of 2
- 06-24-2012, 11:42 AM #1
Member
- Join Date
- Jun 2012
- Posts
- 5
- Rep Power
- 0
- 06-24-2012, 02:26 PM #2
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
Re: How to take contents of file in a string?
If your text file is small in size, the fastest way will be using the java.nio.file.Files.readAllLines() method. This method take a Path as a parameter. This method will then give the result as a collection, a List of String objects. You'll need to use Java 7 for this.
For detail you can find it here: Files (Java Platform SE 7 )Website: Learn Java by Examples
Similar Threads
-
Finding all the contents of the string after a specified letter
By rokit boy in forum Advanced JavaReplies: 2Last Post: 03-18-2012, 04:09 AM -
Reading a text file and creating a String from contents
By paulio2 in forum New To JavaReplies: 5Last Post: 11-17-2011, 04:45 PM -
Checking The Contents of a String
By jayragz in forum New To JavaReplies: 7Last Post: 05-26-2011, 10:15 AM -
Comparing contents of a file with String[]
By eponcedeleon in forum Advanced JavaReplies: 2Last Post: 02-25-2010, 09:10 PM -
Concatinating contents of a string array based on condition
By gangsterooseven in forum Advanced JavaReplies: 2Last Post: 10-07-2009, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks