Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to convert line into string java

File file = new File(fileName);
Scanner input = new Scanner(file);
List<String> list = new ArrayList<String>();

while (input.hasNextLine()) {
    list.add(input.nextLine());
}

//adds each line of a text file into an ArrayList
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #line #string #java
ADD COMMENT
Topic
Name
8+8 =