Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a whereNull() or a nullsCount to iterable extension #337

Open
ValentinVignal opened this issue Mar 12, 2024 · 1 comment
Open

Add a whereNull() or a nullsCount to iterable extension #337

ValentinVignal opened this issue Mar 12, 2024 · 1 comment

Comments

@ValentinVignal
Copy link

ValentinVignal commented Mar 12, 2024

It would be useful to know the number of null in an iterable. For now, I'm creating my own.

extension on Iterable {
  int nullsCount => where((element) => element == null).length;
}
@ValentinVignal ValentinVignal changed the title Add a whereNull() or a countNulls to iterable extension Add a whereNull() or a nullsCount to iterable extension Mar 12, 2024
@arbitur
Copy link

arbitur commented May 13, 2024

Feels like this functionality is very specific to your projects business logic and not so much a general one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants