public static void main(String args[]) { String str = "a b c d e f"; String test = str.replaceAll("\\s{1,}", ""); System.out.println(test); }
public static void main(String args[]) { String str = "aaaaaaaaabbbbbbaaaaaaaa"; String test = str.replaceAll("b", "c"); System.out.println(test); }