Java HTML Encode toHtml(String text)

Here you can find the source of toHtml(String text)

Description

to Html

License

BSD License

Declaration

public static String toHtml(String text) 

Method Source Code

//package com.java2s;
/*L//from   w w  w  .  j av a2  s.c o m
 * Copyright Northrop Grumman Information Technology.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/nci-value-set-editor/LICENSE.txt for details.
 */

public class Main {
    public static String toHtml(String text) {
        text = text.replaceAll("\n", "<br/>");
        text = text.replaceAll("  ", "&nbsp;&nbsp;");
        return text;
    }
}

Related

  1. toHtml(String str)
  2. toHtml(String str)
  3. toHtml(String str)
  4. toHTML(String string)
  5. toHTML(String text)
  6. toHtml(String trace)
  7. toHtml(String txt)
  8. toHtml(String value, String defaultValue)
  9. toHTML(String xhtml)