Created
July 2, 2021 01:19
-
-
Save aniketmlk6/da9cf95b046cc2ec23f418a84f3ecae3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
String input = "Java is awesome"; | |
int count = (int) input.chars().filter(ch -> ch!=' ').count(); | |
System.out.println("Total characters without spaces : " + count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment