Friday, August 15, 2014

Replace end of line (CR/LF carriage return/new line) characters in a file or string using java

Replace end of line (CR/LF) characters in string with another character 'A'

desc = desc.replaceAll("\\r?\\n", "A");
where desc is a String variable.

No comments: