java - Writing new line notepad -
simply trying move new line after printing each element inside of notepad. searching has yielded uses of \r\n, doesn't seem work either.
for(string element : misspelledwords) { writer.write(element + "\n"); }
try this
bufferedwriter writer = new bufferedwriter(new filewriter("result.txt")); (string element : misspelledwords) { writer.write(element); writer.newline(); }
adding line separator @ end (like "\n") should work on os,but on safer side should use system.getproperty("line.separator")
Comments
Post a Comment