Link to home
Start Free TrialLog in
Avatar of abuyusuf35
abuyusuf35

asked on

Defining this string in Java

How would I define this string in Java

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

Thanks
Avatar of for_yan
for_yan
Flag of United States of America image

you use two backlahses instead of one "Doman\\username"
In this way you can escape backslash and it will put only one backslsh into actual text
String s = "Domain\\username";
ASKER CERTIFIED SOLUTION
Avatar of Hugh McCurdy
Hugh McCurdy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial