indexOf

Compile-time function to get the index of the give element.

Performs a linear scan, returning the index of the first occurrence of the specified element in the array, or U.max if the array does not contain the element.

  1. size_t indexOf(T[] arr, dchar element)
    size_t
    indexOf
    (
    T
    )
    (
    T[] arr
    ,
    dchar element
    )
    if (
    isChar!(T)
    )
  2. size_t indexOf(T[] arr, T element)

Parameters

arr T[]

the array to get the index of the element from

element dchar

the element to find

Return Value

Type: size_t

the index of the element or size_t.max if the element was not found.

Meta