I'm having trouble replacing return characters in a JTextArea in windows 7. I have an input textArea that for data storage purposes I want to replace the "\r\n" with a unique string like "#!". Problem is, I can't seem to get it to replace it.
EX of issue:
JTextArea exampleText = new JTextArea("Enter Text",10,3);
String oneLineOfText = exampleText.getText().replace("\r\n","#!");
System.out.println(oneLineOfText);
Input:
Text
Text everywhere
Output:
Text
Text everywhere
Desired Output:
Text#!Text everywhere
I feel like I must be doing something really silly. This works perfectly fine in ubuntu when I use "\n" instead of "\r\n".