I am consuming an api and I noticed that it comes back with \"'s\"
and not an apostrophe. Since I am not going to be displaying this text in html this w
The MatchEveluator is available since .NET 1.0 and comes in handy if you want to address this problem in a more generic fashion - i.e. do more than just HTML character decoding. The general recipe looks like this:
MatchEvaluator ev = (Match m) => Char.ToString((char)Int32.Parse(m.Groups[1].Value));
string result = Regex.Replace("The king's key.";, @"(\d+);", ev);