Search This Blog

Loading...

Monday, August 30, 2010

How to remove non-ASCII characters from a Java String?

We can remove non-ASCII characters from a Java String by using below regular expression.

String.replaceAll("[^\\p{ASCII}]", ""))

No comments:

Post a Comment