1

我正在通过 RSS 提要解析博客上的一系列帖子,幸运的是 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] -->  

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

4

1 回答 1

0

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

于 2012-04-19T15:10:12.280 回答