String s = "hi hello";
s = s.replaceAll("\s*", " ");
System.out.println(s);
I have the code above, but I can't work out why it produces
h i h e l l o
rather than
hi hello
Many thanks
See Question&Answers more detail:os