' \ '-Invalid character constant?

前端 未结 7 1605
夕颜
夕颜 2020-12-19 11:27

I need to do this:

while (result2.charAt(j)!=\'\\\'){

    }

I get an error saying: Invalid character constant.

Why? a

相关标签:
7条回答
  • 2020-12-19 12:22

    you need an extra character '\'

    " " " == " \" "
    
    
    " \ " == " \\ "
    
    0 讨论(0)
提交回复
热议问题