CSharp examples for System:Array Operation
Extract Specific Subset from Array
using System.Text; using System.Collections; using System;/*from w w w . j a v a 2 s. c o m*/ public class Main{ // create a subset from a specific list of indices public static T[] ExtractSpecificSubset<T>(this T[] array, params int[] indices) { T[] subset = new T[indices.Length]; for (int i = 0; i < indices.Length; i++) { subset[i] = array[indices[i]]; } return subset; } }