我正在通过 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/