Skip to content
Advertisement

Does Java have the ‘@’ character to escape string quotes?

My string has double quotes in it, in C# I would do:

JavaScript

how would I do that in Java?

Advertisement

Answer

No. Such a feature is not available in Java.
From the Sun docs:

When an escape sequence is encountered in a print statement, the compiler interprets it accordingly. For example, if you want to put quotes within quotes you must use the escape sequence, “, on the interior quotes. To print the sentence

She said "Hello!" to me.

you would write

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement