Re: Simple HTML -> Text converter
Zak Burke <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Guido Neitzer wrote on 4/6/06 7:39 AM:
> I'm looking for a simple class, that takes an HTML string, strips all
> HTML tags and returns the plain text string. Is there something around,
> that can be used easily from WO?
/**
* 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("<[^>]+>", "");
}
zak.