如何在Java中转义引号 [英] How to escape quotes in Java

查看:456
本文介绍了如何在Java中转义引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我坚持这个:

我有一个 ResultSet 来写一个html报告。 ResultSet

I have a ResultSetto write in a html report. the ResultSetis

writer.write("<td><a href=>" + "../" + rsevidencia.getString("Evidencia") + 
             "<a/></td>");

但链接不起作用,因为Evidencia没有引号,怎么能把 ResultSet 参数内的引号?

But the link doesn't work because "Evidencia" is not into quotes, how to can I put quotes inside the ResultSet argument?

ResultSet 带来这个2013-10-10 09:15:00.110

The ResultSet brings this 2013-10-10 09:15:00.110

推荐答案

你可以用\Evicendia \
在java中,您可以使用 \ 访问escapate字符。

you can use "\"Evicendia\"". In java, you can access to escapate chars using \.

这篇关于如何在Java中转义引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆