public static String removeControlCharacters ( String s , boolean removeCR ) { String ret = s ; if ( ret != null ) { ret = ret . replaceAll ( "_x000D_" , "" ) ; if ( removeCR ) ret = ret . replaceAll ( "\r" , "" ) ; } return ret ; }
Remove any extraneous control characters from text fields .