endsWithAmong

Array-specialization of endsWith with default predicate.

  1. bool endsWithAmong(T[] haystack, T[][] needles)
  2. bool endsWithAmong(T[] haystack, T[] needles)
    bool
    endsWithAmong
    (
    T
    )
    (
    scope const T[] haystack
    ,
    scope const T[] needles
    )
  3. bool startsWith(T[] haystack, T[] needle)
  4. bool startsWith(T[] haystack, T needle)

Examples

const x = "beta version";
assert(x.endsWithAmong(["version", ""]));
assert(x.endsWithAmong(['n', ' ']));
assert(x.endsWithAmong("n "));
assert(!x.endsWithAmong(["_"]));
assert(!x.endsWithAmong(['_']));

Meta