I need to do this:
while (result2.charAt(j) != '\'){
}
I get an error saying: Invalid character constant
.
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)!='\\'){
}
Use '\\'
. It's because backslash is used in escape sequence like '\n'
. With a single \
the compiler have no way to know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With