I have a column in database which contains non printable characters;
String xyz = "Company Name\r\n Magna";
Once retrieved from database, in java, the values is shown as below
String companyname = "Company Name\\r\\n Magna";"
It adds an addtional escape character. How can i remove the non printable characters now ?
companyname.replaceAll("\\p{Cntrl}", ""); // Doesn't work.
Even if i use StringBuffer
, it won't work because of additional escape character.
Please advice.