When I receive input via C# it comes in escaping the \
. When I'm trying to parse the string it causes an error because its using \\r
instead of \r
in the string. Is there some way to prevent it from escaping the \
or perhaps turning \\
into \
in the string. I've tried:
protected string UnEscape(string s)
{
if (s == "")
return " ";
return s.Replace(@"\\", @"\");
}
With no luck. So any other suggestions.
EDIT:
I was not specific enough as some of you seemed confused as to what I'm trying to achieve. In debug I was reading "\\t"
in a string but I wanted "\t"
not because I want to output \t
but because I want to output a [tab]. With the code above I was sort of trying to recreate something that has already been done through Regex.Unescape(string).