2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

how to remove new line character in java string

how to remove new line character in java string
userimage
try as below to remove new line char from a string using java:


public static String removeNewLineFromString(String str) {
        return str.replaceAll("(/r|/n)", "");
 }

Answer is