Answers for "get all index of c#"

C#
1

get index c#

int index = Array.IndexOf(arr,item);
Posted by: Guest on August-17-2021
0

c# find all indexes

public static int[] FindAllIndexOf<T>(this T[] array, Predicate<T> filter)
        {
  			// Note: If select does not find a match returns index as "-1"
            int[] indexes = array.Select((elementInArray, index) => filter(elementInArray) ? index : -1)
                                 .Where(index => index != -1).ToArray();

            return indexes;
        }
Posted by: Guest on June-17-2021

Code answers related to "get all index of c#"

C# Answers by Framework

Browse Popular Code Answers by Language