Java equivalent of C#’s verbatim strings with @

Quick question. Is there an equivalent of @ as applied to strings in Java:

For example I can do @"c:afolderafile" in C# and have it ignore the escape characters when processing instead of having to do "c:\afolder\aFile". Is there a Java equivalent?

hmmm: stackoverflow is escaping on me .. lol. The second example should read:

c:(double-backslash)afolder(double-backslash)aFile

Answer

No. Escaping / externalizing the string is your only choice.

Leave a Reply

Your email address will not be published. Required fields are marked *