fork download
  1. class Test {
  2. public static void main (String[] args) throws java.lang.Exception {
  3. String s = "t e s t s t r i n g";
  4. System.out.println(s.replaceAll("( ) | ", "$1"));
  5. }
  6. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
test string