count
Counts elements in this iterable that satisfy predicate within the index range starting at from.
Iteration stops when the current index reaches to (the element at index to is not counted). If from is greater than or equal to to, returns 0. Requires to to be at least -1.
Receiver
This iterable to count over in iteration order.
Return
The number of elements in the considered index range that satisfy predicate.
Parameters
The inclusive lower bound on element indices to consider. Defaults to 0.
The exclusive upper bound on element indices; iteration stops when this index is reached. Defaults to -1.
Type Parameters
The element type of this iterable.
Counts elements in the sublist [from, to) that satisfy predicate.
Receiver
This list to count over.
Return
The number of elements in [from, to) that satisfy predicate.
Parameters
The inclusive start index of the range to count in. Defaults to 0.
The exclusive end index of the range to count in. Defaults to size.
Called with each element in the range; should return true for elements to count.
Type Parameters
The element type of this list.
Counts elements in this int array that satisfy predicate within the index range [from, to].
Indices are clamped to [0, size]. The range is inclusive on both ends.
Receiver
This int array to count over.
Return
The number of elements in the range that satisfy predicate.
Parameters
The inclusive lower bound on indices to consider. Defaults to 0.
The inclusive upper bound on indices to consider. Defaults to size.
Called with each element in the range; should return true for elements to count.
Counts elements in this boolean array that satisfy predicate within the index range [from, to].
Indices are clamped to [0, size]. The range is inclusive on both ends.
Receiver
This boolean array to count over.
Return
The number of elements in the range that satisfy predicate.
Parameters
The inclusive lower bound on indices to consider. Defaults to 0.
The inclusive upper bound on indices to consider. Defaults to size.
Called with each element in the range; should return true for elements to count.