去掉标签元素

mac2022-06-30  95

只保留文本的内容。利用正则表达式就可以很容易做到这一点:

String noHtmlContent = content.replaceAll("<[^>]*>","");

转载于:https://www.cnblogs.com/yanjunwu/p/3539798.html

最新回复(0)