com.jidesoft.utils.HtmlUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jide-oss Show documentation
Show all versions of jide-oss Show documentation
JIDE Common Layer (Professional Swing Components)
/*
* @(#)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