Hi all, I have the following code, public static void test2() { String newLine = System.getProperty("line.separator"); String TOKEN="TOKEN"; String s = "abc maulin vasavada"; StringBuffer sb = new StringBuffer(); sb.append(s).append(newLine). append(s).append(newLine). append(s); String s1 = sb.toString(); System.out.println(s1); s1 = s1.replaceAll("\\s+",TOKEN); System.out.println(s1); } Here the problem is, "\\s+" pattern matches the newlines in the string and replace them with TOKEN. I want ...