indexOf

Complement to std.string.indexOf which works with arrays of non-character types. Unlike std.algorithm.countUntil, it does not auto-decode, and returns an index usable for array indexing/slicing.

  1. sizediff_t indexOf(T[] arr, D val)
    sizediff_t
    indexOf
    (
    T
    D
    )
    (
    in T[] arr
    ,
    in D val
    )
    if (
    !isSomeChar!T &&
    is(typeof(arr.countUntil(val)))
    &&
    is(typeof(arr[0] == val))
    )
  2. sizediff_t indexOf(T[] arr, T[] val)

Meta