Posted by Toby Inkster on 11/18/05 10:00
Yashwant wrote:
> I want some information and documentation about how to convert text to
> html using java?
My Java is a little rusty, but...
class TextToHTML
{
private String starttag = "\n<pre>";
private String finaltag = "</pre>\n";
public String convert (String text)
{
String html;
html = text.replaceAll("&", "&");
html = html.replaceAll("<", "<");
return starttag + html + finaltag;
}
}
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|