问题:上传一个富文本的笔记,在记录里面查看列表项需要显示一个概要,但是服务器端获取
的是一个h5串,那就需要把里面的文字解析出来。


一、添加依赖
dependencies { compile 'org.jsoup:jsoup:1.9.2' }二、解析
Document doc = Jsoup.parse("需要转化的string");
String txt = doc.body().text();
本文介绍了一种将富文本格式的笔记转换为纯文本的方法,通过使用Jsoup库解析HTML内容并提取文本部分。


dependencies { compile 'org.jsoup:jsoup:1.9.2' }Document doc = Jsoup.parse("需要转化的string");
String txt = doc.body().text();
被折叠的 条评论
为什么被折叠?