A.str =str.replaceAll("\\s{1,}","");B.str =str.replaceAll("\\s","");C.str =str.replaceAll("\\s*","");D.str =str.replaceAll("\\s+","");
A."\\s{1,}"B."\\S*"C."\\S{1,}"D."\\s+"
A."x+"B."//w*x?//w*"C."x{1,}"D."//w*x//w*"