Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Replace \n in BufferedWriter.write()?
- String input = "Name: adfasd n AN: asdfasdf n";
- Writer textOutput = null;
- File file = new File("write.txt");
- textOutput = new BufferedWriter(new FileWriter(file));
- textOutput.write( input );
- textOutput.close();
- String text = "Line 1 \n Line2";
- System.out.println(text);
- System.out.println(text.replace("\n", "n"));
- public void test() throws IOException {
- BufferedWriter writer = new BufferedWriter(new FileWriter("/someDir/test.txt"));
- writer.write("HellonWorld");
- writer.close();
- }
- Hello
- World
Add Comment
Please, Sign In to add comment