I am trying to write an array to a file using a loop, but every time I open the text file it only shows the last line. If I write the array directly with a toString it has the extra spaces and array characters I don't want. Here is my code for writing to the array
WriteFile data = new WriteFile(file_namec2g , true);
for (String s : full) {try {
data.writeToFile(s );
} catch (IOException ex) {
Logger.getLogger(CC2LevelManagerUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
Write file is my file writing class. I can post that in another comment if it would be useful. It is one I found on the internet.File_namec2g is the name of the file and the true is if it overwrites or not. So my question is how can I get the array to print line by line into a text file that will show up as such in a program like notepad?