Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

string.Where() in Unity C#?

Discussion in 'Scripting' started by JTown, Apr 28, 2012.

  1. JTown

    JTown

    Joined:
    Jan 9, 2010
    Posts:
    984
    What I'm trying to do: http://stackoverflow.com/questions/...ir-equivalent-such-as-a-for-a/2393966#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 (csharp):
    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
     
    Last edited: Apr 29, 2012