Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
final var totalDigits = string.chars()
.filter(Character::isDigit)
.count();
final var totalUppercaseChars = string.chars()
.filter(Character::isUpperCase)
.count();
final var totalLowercaseChars = string.chars()
.filter(Character::isLowerCase)
.count();
final var totalInvalidChars = string.chars()
.filter(character -> !Character.isLetterOrDigit(character))
.count();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment