过滤Web服务响应

时间:2013-12-23 10:06:00

标签: android

我从服务器获得响应,但值包含html标签。我想在将值存储在变量中时删除这些标记。我应该遵循哪种方法。谢谢你的考虑。我正在粘贴一些回复:

 "<p><strong>The item is a 17.78 cm (7) tablet that is packed with multiple features. What is most inviting is that it enables you to voice call your friends or have a video chat with them on its  0.3M front mounted camera. Music lovers will also enjoy it: from its carefully positioned speakers to its Dolby® audio enhancement, the A1000 delivers a dazzling music</strong></p>\n<p><strong>Enjoy Voice Calling</strong></p>\n<p>The  comes with SIM support for Voice Calling. Use it like a tablet or a regular phone. The choice is all yours.</p>\n<p><strong>Enhanced Stereo Speakers</strong></p>\n<p>Enjoy an enhanced audio experience for.. "

1 个答案:

答案 0 :(得分:1)

我在这里得到了解决方案。它对我来说很好。

String properResponse= responseWithHtml.replaceAll("\\<.*?>","");