Defining this string in Java

How would I define this string in Java

"Domain\Username" since Java won't accept the backslash ?

Thanks
abuyusuf35Asked:
Who is Participating?
 
Hugh McCurdyConnect With a Mentor Commented:
Why do you need a \ ?  Have you tried / to see if it works?
0
 
for_yanCommented:
you use two backlahses instead of one "Doman\\username"
0
 
for_yanCommented:
In this way you can escape backslash and it will put only one backslsh into actual text
0
 
for_yanCommented:
String s = "Domain\\username";
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.