Dear team,
I am trying to write code for reading files with text content. The problem is that the
string values which I have contain both new line escape characters as well as carriage returns. I need to get my strings rid of the carriage returns only and not the new line escape characters. Could some one please help me out here?
System.out.println("START- " + dataString + " -END");
System.out.println();
System.out.println("START- " + dataString.replaceAll("\\n","") + " -END");
System.out.println();
System.out.println("START- " + dataString.replaceAll("\\r", "") + " -END"); --- doesn't work
The output is:
START- Configure synchronization and upload of all processes or specific process
Configure synchronization and upload of all processes or specific process -END
START- Configure synchronization and upload of all processes or specific process Configure synchronization and upload of all processes or specific process -END
START- Configure synchronization and upload of all processes or specific process
Configure synchronization and upload of all processes or specific process -END