Reputation: 2655
I currently have a string like this:
string login = "DOMAIN\" + userID
Obviously this does not work as I need the backslash escape sequence, right?
string login = "DOMAIN\\" + userID
This displays DOMAIN\\jcwhisman
with 2 backslashes?
I have tried all of these in hopes that something will work. While these don't all display 3 slashes, none of them display what I need:
string login = @"DOMAIN\" + userID
string login = @"DOMAIN\\" + userID
string login = "DOMAIN\\" + userID
string login = "DOMAIN\" + userID
I know some of those don't seem logical, but I have just been trying everything I can.
I need it to display as DOMAIN\jcwhisman
Upvotes: 0
Views: 318
Reputation: 101701
Your two ways are correct and should give you exactly what you want:
string login = @"DOMAIN\" + userID
string login = "DOMAIN\\" + userID
Just make sure that you don't have a backslash at the beginning of your userID
.
Upvotes: 1