android – 如何用双引号将HTML数据添加到java中的String?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了android – 如何用双引号将HTML数据添加到java中的String?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1580字,纯文字阅读大概需要3分钟。
内容图文
![android – 如何用双引号将HTML数据添加到java中的String?](/upload/InfoBanner/zyjiaocheng/723/1d3b7609a7eb4762b52e00692e2462e9.jpg)
String s=
"<html>
<head>
<title>app</title>
</head>
<body bgcolor="pink">
<div align="center"><img src="" width="900" height="100"/>
</div>
<h2 align="center">Welcome to your rewards program</h2>
<table>
<tr>
<td><p> You now have ongoing uninterrupted access to thousands of discounts all on your phone .Accessing great savings just got so easier . You can search by category , by keyword and also search local with what around me. Select a merchant offer you like and present the coupon on your phone at the time of settling your bill . Some merchants only offer their services online and you will also be able to click through to their online offerings .
GIN image</p></td>
</tr>
</table>
</body>
</html>";
我想将html数据添加到字符串中,但它给了我错误.我怎么能解决这个问题?
我使用了escapse序列,但它没有用.
谢谢
解决方法:
试试这个
String s=
"<html>"+
"<head>"+
"<title>app</title>"+
"</head>"+
"<body bgcolor=\"pink\">"+
"<div align=\"center\"><img src=\"\" width=\"900\" height=\"100\"/>"+
"</div>"+
"<h2 align=\"center\">Welcome to your rewards program</h2>"+
"<table>"+
"<tr>"+
"<td><p> You now have ongoing uninterrupted access to thousands of discounts all on your phone .Accessing great savings just got so easier . You can search by category , by keyword and also search local with what around me. Select a merchant offer you like and present the coupon on your phone at the time of settling your bill . Some merchants only offer their services online and you will also be able to click through to their online offerings ."+
"GIN image</p></td>"+
"</tr>"+
"</table>"+
"</body>"+
"</html>";
内容总结
以上是互联网集市为您收集整理的android – 如何用双引号将HTML数据添加到java中的String?全部内容,希望文章能够帮你解决android – 如何用双引号将HTML数据添加到java中的String?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。