Java examples for java.lang:String New Line
convert new line to <br>
//package com.java2s; public class Main { public static void main(String[] argv) { String input = "\nbon\n\n\n\n\n\k2s.com"; System.out.println(nl2br(input)); }// w w w. jav a2s. c om public static String nl2br(String input) { if (input == null) return null; return input.replaceAll("\n", "<br>"); } }