我正在通过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("{\\<.*?\\>}", ""
in黑莓开发。请问需要删除标签的这个文字?
以下是文本示例:
<!-- [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] -->
非常感谢,我感谢任何帮助!
答案 0 :(得分:0)
由于使用正则表达式是一种不好的形式(请参阅RegEx match open tags except XHTML self-contained tags),请查看http://jsoup.org