Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ArrayUtility.FindIndex

static function FindIndex(array: T[], match: Predicate<T>): int;
static int FindIndex(T[] array, Predicate<T> match);
static def FindIndex(array as T[], match as Predicate<T>) as int

Returns

int The zero-based index of the first occurrence of the element, if found; otherwise, �1.

Description

Find the index of the first element that satisfies the predicate.