I have a string formatted with an instance of NumberFormat. When I show the characters of a string, I have inextricable space (hexa code: A0 and unicode 160). How can I remove this character from my string. I tried string = string.replaceAll("\u0160", "");
and string = string.replaceAll("0xA0", "")
, both did not work.
String string = ((JTextField)c)getText(); string = string.replace("\u0160", ""); System.out.println("string : " string); for(int i = 0; i < string.length; i++) { System.out.print("char : " + string.charAt(i)); System.out.printf("Decimal value %d", (int)string.charAt(i)); System.out.println("Code point : " + Character.codePointAt(string, i)); }
The output still contains a space with a decimal value of 160 and a code of 160.
xtrem06
source share