I currently have the following code:
string user = @"DOMAIN\USER"; string[] parts = user.Split(new string[] { "\\" }, StringSplitOptions.None); string user = parts[1] + "@" + parts[0];
The user input string can be in one of two formats:
DOMAIN\USER DOMAIN\\USER (with a double slash)
What is the most elegant way in C # to convert one of these lines to:
USER@DOMAIN
general exception
source share