Java : replacing text URL with clickable HTML link

前端 未结 6 774
不知归路
不知归路 2020-12-20 13:54

I am trying to do some stuff with replacing String containing some URL to a browser compatible linked URL.

My initial String looks like this :

\"hell         


        
6条回答
  •  猫巷女王i
    2020-12-20 14:13

    For anybody who is searching a more robust solution I can suggest the Twitter Text Libraries.

    Replacing the URLs with this library works like this:

    new Autolink().autolink(plainText) 
    

提交回复
热议问题