Select array item by type

image_pdfimage_print
   
 
using System;
using System.Linq;

static class TestArray {
    static void Main() {
        Object[] array = { "String", 12, true, 'a' };

        var types =
          array
            .Select(item => item.GetType().Name)
            .OrderBy(type => type);
    }
}

    


This entry was posted in LINQ. Bookmark the permalink.