after method
Returns everything after sub.
1, 2, 3.after(1) returns 2, 3.
1, 2, 3.after(1, 2) returns 3.
1, 2, 3.after([]) returns 1, 2, 3.
Optional skip skips that many occurrences:
1, 2, 1, 2, 3.after(1, skip: 1) returns 2, 3.
1, 2, 3.after([], skip: 1) returns 2, 3.
If sub is present, includeInResult will include it at the beginning:
1, 2, 3.after(2, includeInResult: true) returns 2, 3.
overlap determines how occurrences are counted for skip:
1, 2, 1, 2, 1, 2, 1.after(1, 2, 1, skip: 1) returns [], but
1, 2, 1, 2, 1, 2, 1.after(1, 2, 1, skip: 1, overlap: true) returns 2, 1.
Default h.symmetricDeepEquals counts occurrences by checking DeepCollectionEquality().equals in both
directions since it is normally asymmetric, but custom equalityFunction can be given that will
compare elements in original to elements in sub.
Implementation
Set<E> after(
Iterable<E> sub, {
int skip = 0,
bool overlap = false,
bool includeInResult = false,
bool reverse = false,
bool Function(E a, E b) equalityFunction = h.symmetricDeepEquals,
}) {
return h
.afterIterable(
original: this,
sub: sub,
skip: skip,
overlap: overlap,
reverse: reverse,
includeInResult: includeInResult,
equalityFunction: equalityFunction,
)
.toSet();
}