I am pretty new in C#
and I am finding the following difficulties with a string replace operation.
I have the following situation:
string utenteActiveDirectory = utente.UserId.Split('|')[1].Replace("\\", @"\");
where utente.UserId.Split('|')[1]
contains the following string: domain\\username
.
I have to replace the double \\
with the single \
character. But trying with the previous line of code it is not working and I still have domain\\username
instead the expected domain\username
result.
Why? What is wrong? What am I missing? How can I fix it?