public static String removeNewLineChars(final String string){
  if (StringUtils.isBlank(string)) {
    return string;
  }
  String newLineRegularExpression="(\\n)";
  return string.replaceAll(newLineRegularExpression,"");
}

public static String removeNewLineChars ( final String string ) { if ( StringUtils . isBlank ( string ) ) { return string ; } String newLineRegularExpression = "(\\n)" ; return string . replaceAll ( newLineRegularExpression , "" ) ; }
removes new line character from a string .
