Regular expression in Java is handy to remove non-printable character (control character, ASCII 0 - 31, 127) from a String:
String truncated = originalString.replaceAll("\\p{Cntrl}", "");
// shall I write some keywords here to boost search engine ranking?
Regular expression in Java is handy to remove non-printable character (control character, ASCII 0 - 31, 127) from a String:
String truncated = originalString.replaceAll("\\p{Cntrl}", "");
2 comments:
Non-printable crap didn't want to go throught xml, this fixed it, thanks!
Thank you!
Saved me from control-character ASCII #18/ HTML-escape %18.
greez Dreanaught
Post a Comment