How can I remove a part of a string in C# when the string contains non-ascii characters?
<p>I asked a question about how to remove pronunciation and the non-ascii value that follows it from part of a string response.Body that contains this:</p>

<pre><code>  {...."pronunciation" : "ʌ'bændʌnmʌnt", "frequency" : 2.98}
</code></pre>

<p>The word following pronunciation is containing characters that seem to be not working with Regex.</p>

<p>The suggestion was to use: </p>

<pre><code>  Regex.Replace(response.Body, @"\s*""pronunciation""\s*:[^,]*,", "")
</code></pre>

<p>But this does not seem to work. </p>

<p>Is there another way that I could reduce the section of my string that starts with "pronunciation" completely. </p>

<p>For reference here are details on the characters used:</p>

<p><a href="https://en.wikipedia.org/wiki/International_Phonetic_Alphabet" rel="nofollow">https://en.wikipedia.org/wiki/International_Phonetic_Alphabet</a></p>

<p>Note the reason I would like to remove it is because I am not using it and also when I try the following code it gives an exception with a message pointing to the value of the pronunciation as being the cause of the error:</p>

<pre><code> RootObject rootObject = JsonConvert.DeserializeObject&lt;RootObject&gt;(response.Body);
</code></pre>

<p>Just a thought. If Regex is not working then would it be reasonable to have a solution that looked for the position of pronunciation and of frequency and removed the value by doing a substring? I would also be okay to accept that as a suggestion if nobody has an idea how to solve it with Regex.</p>

<p>Update:</p>

<p>Here is the data I added from the original question. Note that the Json string has been formatted. Normally it's not formatted and is just a plain string with no new lines:</p>

<p>I have this API call:</p>

<pre><code> HttpResponse&lt;string&gt; response = Unirest
                .get("https://wordsapiv1.p.mashape.com/words/" + word.Name)
                .header("X-Mashape-Key", "xxxx")
                .header("Accept", "application/json")
                .asJson&lt;string&gt;();
</code></pre>

<p>For words it retrieve this type of response:</p>

<pre><code>{
    "word" : "abandonment",
    "results" : [{
            "definition" : "withdrawing support or help despite allegiance or responsibility",
            "partOfSpeech" : "noun",
            "typeOf" : ["disposal", "disposition"],
            "hasTypes" : ["throwing away", "discard"],
            "derivation" : ["abandon"]
        }
    ],
    "syllables" : {
        "count" : 4,
        "list" : ["a", "ban", "don", "ment"]
    },
    "pronunciation" : "ʌ'bændʌnmʌnt",
    "frequency" : 2.98
}
</code></pre>

<p>Here's the API that I was using to get the data:</p>

<pre><code>  https://market.mashape.com/wordsapi/wordsapi#
</code></pre>