Hapus spasi ekstra java

String after = before.trim().replaceAll(" +", " ");
yuan Tao