The fastest way to remove Unicode codes from a string

Hi, I am trying to figure out how to remove tags from results returned from the Google feed API. In particular, they put bold tags in the headings and inside the description.

Paste Codes:

\u003cb
\u003e
\u003c/b\u003e

Since its a fixed amount, I tried to do String.Replace () for each of these codes per line, but this led to poor performance not surprisingly. I'm not sure if RegEx will be better (or worse). Does anyone have an idea on how to remove them? Google does not provide the ability to remove tags from results.

+3
source share
1 answer

You can remove unicode codes using a regex like this:

\\u[\d\w]{4}

var subject = @"\u003cb\u003e\u003c/b\u003e";
var result = Regex.Replace(subject, @"\\u[\d\w]{4}", String.Empty);

, , , , , . . , , , , . , , , .

, RegexOptions.Compiled, , .

+2

All Articles