Hi,
You could either double the \ or put an @ before the string like so:
string userName = "DOMAIN\\username".Replace("\\","");
string userName = @"DOMAIN\username".Replace(@"\","");
But this will only replace the \ character. If you want tto get rid of DOMAIN also you could do like this:
int p = userName.IndexOf(@"\");
if (p > -1) userName = userName.Remove(0, p);
/peter