'\' - 字符常量无效? [英] ' \ '-Invalid character constant?
本文介绍了'\' - 字符常量无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要这样做:
while (result2.charAt(j)!='\'){
}
我收到错误消息:无效字符常量
。
为什么?我怎么能克服它?
Why? and how can I get over it?
推荐答案
反斜杠是一个特殊字符,它需要用另一个反斜杠进行转义。像这样:
The backslash is a special character and it needs to be escaped with another backslash. Like this:
while (result2.charAt(j)!='\\'){
}
这篇关于'\' - 字符常量无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文