String palabra= "a.b.c.d."; palabra=palabra.replace('.',' '); System.out.println(palabra.replaceAll(" ", ""));