Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the counterpart in Java of C#'s @ string literal?

C# has the @ string literal to flexibly handle escape characters in strings. Is there anything like that in Java?

like image 843
Tae-Sung Shin Avatar asked Dec 04 '11 20:12

Tae-Sung Shin


2 Answers

There isn't. You'll need to escape your strings.

like image 184
Jim Rush Avatar answered Sep 20 '22 19:09

Jim Rush


This is called a verbatim string literal.
Java does not have such a feature.

like image 22
SLaks Avatar answered Sep 24 '22 19:09

SLaks