skipOverBack

Array-specialization of skipOverBack with default predicate.

See: std.string.chomp

  1. bool skipOverBack(inout(T)[] haystack, T[] needle)
  2. bool skipOverBack(inout(T)[] haystack, T needle)
    @trusted
    bool
    skipOverBack
    (
    T
    )
    (
    scope ref inout(T)[] haystack
    ,
    scope const T needle
    )
  3. bool startsWith(T[] haystack, T[] needle)
  4. bool startsWith(T[] haystack, T needle)

Examples

string x = "beta version";
assert(x.skipOverBack(" version"));
assert(x == "beta");
assert(x.skipOverBack('a'));
assert(x == "bet");
assert(!x.skipOverBack("_"));
assert(x == "bet");
assert(!x.skipOverBack('_'));
assert(x == "bet");

See Also

Meta