I have a issue when I look up a user name using the code below if the user has \v in their name. For Example, if their user name is xxx\vtest, it can't find the backslash when using the LastIndexOf function.
string strUser = this.Context.User.Identity.Name;
strUser = strUser.Substring(strUser.LastIndexOf("\\") + 1);
If I do try this, it works with no problems.
string strUser = @"xxx\vtest";
strUser = strUser.Substring(strUser.LastIndexOf("\\") + 1);
Any ideas on how to ignore the escape character while using User.Identity.Name?