All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jidesoft.utils.HtmlUtils Maven / Gradle / Ivy

There is a newer version: 3.6.18
Show newest version
/*
 * @(#)HtmlUtils.java 6/8/2011
 *
 * Copyright 2002 - 2011 JIDE Software Inc. All rights reserved.
 */

package com.jidesoft.utils;

public class HtmlUtils {
    public static final String HTML_START = "";
    public static final String HTML_END = "";
    public static final String HTML_LINE_BREAK = "
"; public static String formatHtmlSubString(String text) { if (text != null) { if (text.toLowerCase().startsWith(HTML_START)) { text = text.substring(HTML_START.length()); } if (text.toLowerCase().endsWith(HTML_END)) { text = text.substring(0, text.length() - HTML_END.length()); } text = text.replaceAll("\r\n", HTML_LINE_BREAK); text = text.replaceAll("\r", HTML_LINE_BREAK); text = text.replaceAll("\n", HTML_LINE_BREAK); if (text.startsWith("/")) { return "/" + text.substring(1); } } return text; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy