newLineToBr static method

String newLineToBr(
  1. String str
)

Converts \n to
s or
s. @param {string} str The string in which to convert newlines. @return {string} A copy of {@code str} with converted newlines.

Implementation

static String newLineToBr(String str)
{
  return str.replaceAll( new RegExp("\\r\\n|\\r|\\n"), "<br />");
}