• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

Defining this string in Java

How would I define this string in Java

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

Thanks
0
abuyusuf35
Asked:
abuyusuf35
  • 3
1 Solution
 
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
 
Hugh McCurdyCommented:
Why do you need a \ ?  Have you tried / to see if it works?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now