📅  最后修改于: 2022-03-11 14:48:55.810000             🧑  作者: Mango
public static int[] FindAllIndexOf(this T[] array, Predicate 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;
}