Unity Community


Results 1 to 1 of 1

  1. Location
    Dallas, TX
    Posts
    843

    Replacing diacritics (accents) in C#?

    What I'm trying to do: http://stackoverflow.com/questions/2...393966#2393966

    edit: HttpUtility isn't available because System.Web isn't recognized... any way to get around this? Making iOS app if that makes any difference.


    original post:
    Code:  
    1. string decomposed = input.Normalize(System.Text.NormalizationForm.FormD);
    2. char[] filtered = decomposed.Where(c => char.GetUnicodeCategory(c) != System.Globalization.UnicodeCategory.NonSpacingMark).ToArray();
    3. string newString = new String(filtered);

    Unity doesn't like the .Where(). Is there a way to get that to work or is there a way I can just rewrite it?

    edit: using System.Linq; got it to compile. thanks to Zerot on irc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •