startsWith

Array-specialization of startsWith with default predicate.

  1. bool startsWith(T[] haystack, T[] needle)
    @trusted
    bool
    startsWith
    (
    T
    )
    (
    scope const T[] haystack
    ,
    scope const T[] needle
    )
  2. bool startsWith(T[] haystack, T needle)

Examples

const x = "beta version";
assert(x.startsWith("beta"));
assert(x.startsWith('b'));
assert(!x.startsWith("_"));
assert(!"".startsWith("_"));
assert(!"".startsWith('_'));

See Also

Meta