×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Boulty Doolin
Added: Nov 11, 2016 3:35 PM
Views: 8
Reads the entire contents of a text file into a string.
  1. Scanner scanner = new Scanner(new File("filename")).useDelimiter("\\Z");
  2. String content = scanner.next();
  3. scanner.close();
  4.