java - 在 Blackberry Java 中剥离一串 html 标签

标签 java blackberry

我正在通过 RSS feed 解析博客上的一系列帖子,幸运的是,text() 中有一系列 html 标签,我尝试使用 Replace() 方法,但出现以下错误:The method replace(char, char) in the type String is not applicable for the arguments (String, String) Here is my code: String stripString = mDesCollect.replace("{\\<.*?\\>}", ""在黑莓开发中。请问需要如何去除标签中的这段文字吗? 以下是文本示例:

<!-- [DocumentBodyStart:4accc09d-2c60-4371-956f-1293c4a9746a] --><div class="jive-rendered-content"><p>Hello everyone. Blessed be the God and Father of our Lord Jesus Christ, who hath blessed us with all spiritual blessings in heavenly places in Christ (Ephesians 1:3). </p><p>We're in the second week of this special month of preparation. We'll pray at 12noon, 5pm and 10pm (GMT+1) for 15min, speaking in tongues fervidly and declaring words of faith regarding any situation of concern. God bless you.</p></div><!-- [DocumentBodyEnd:4accc09d-2c60-4371-956f-1293c4a9746a] -->  

非常感谢,感谢任何帮助!

最佳答案

由于使用正则表达式是一种不好的形式(请参阅 RegEx match open tags except XHTML self-contained tags ),请查看 http://jsoup.org

关于java - 在 Blackberry Java 中剥离一串 html 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10231020/

相关文章:

java - 浏览器字段 Cookie 删除

java - 准备好的语句和 JDBC 驱动程序

java 循环与 Integer.MAX_VALUE

移动网站上的 Iphone 和 Blackberry 特定宽度问题

java - 黑莓自动完成字段上的占位符文本

javascript - webkit 属性在黑莓 6 中不起作用

blackberry - 如何解决黑莓模拟器中的这个 JVM 错误?

java - 对于图像,Java 中的 Word Doc(.docx) 中不会发生附加操作

java - 通过命令行参数设置 Spring Boot 属性

java - RxAndroid,结合多个网络调用