Convert plain text to HTML text in Java

前端 未结 6 639
-上瘾入骨i
-上瘾入骨i 2020-12-05 10:53

I have java program, which will receive plain text from server. The plain text may contain URLs. Is there any Class in Java library to convert plain text to HTML text? Or an

6条回答
  •  时光取名叫无心
    2020-12-05 11:45

    If your plain text is a URL (which is different from containing a hyperlink, as you wrote in your question), then transforming it into a hyperlink in HTML is simply done by

    String hyperlink = "" + url + "";
    

提交回复
热议问题