If a string contains any non-ASCII value, i need to to delete it.
I have tried replaceAll mrthod which is working fine with jdk 1.8 and above. but i want to deploy the same on jdk 1.6 and is it not functioning.
String Remarks2 ="hii:╘’i";
String Remarks = Remarks2.replaceAll("[^\\p{ASCII}]", "");
System.out.println("ans: "+Remarks);
Output in jdk 1.8: hii:i Output in jdk 1.6: hii:╘’i
Actual result must be- hii:i