How to remove " " from java string

Greg picture Greg · Jul 23, 2010 · Viewed 66.1k times · Source

I have a java string with " " from a text file the program accesses with a Buffered Reader object. I have tried string.replaceAll(" ","") and it doesn't seem to work.

Any ideas?

cleaned = cleaned.replace(" "," ");

Answer

Nitin Phadnis picture Nitin Phadnis · May 21, 2011
cleaned = cleaned.replace("\u00a0","")