Category Image Removing HTML tags from text


Courtesy of Zak Burke on the WebObjects dev list:

/**
* Return input string with simple HTML tags removed. The
* original string is not changed.
*
* @param s string with embedded HTML markup
* @return string with HTML tags removed.
*/
public void tagZap(String s)
{
return s.replaceAll("<[^>]+>", "");
}

Courtesy of Zak Burke on the WebObjects dev list:

/**
* Return input string with simple HTML tags removed. The
* original string is not changed.
*
* @param s string with embedded HTML markup
* @return string with HTML tags removed.
*/
public void tagZap(String s)
{
return s.replaceAll("<[^>]+>", "");
}

Posted: Thursday - April 06, 2006 at 10:02 AM        


Published by