Java examples for java.lang:String UTF
Utility method to remove non-ASCII characters from a string.
//package com.java2s; public class Main { /**/*from ww w. jav a2 s. c o m*/ * Utility method to remove non-ASCII characters from a string. * @param string * @return */ public static String removeNonAsciiCharacters(String string) { return string.replaceAll("[^\\x00-\\x7F]", ""); } }