Last active
July 2, 2021 14:21
-
-
Save aniketmlk6/86aa088b0d4b737260afc69dcc2c2e5c to your computer and use it in GitHub Desktop.
This file contains 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"; | |
String inputWithoutSpaces = input.replace(" ",""); | |
// System.out.println(inputWithoutSpaces); // String without spaces | |
int count = inputWithoutSpaces.length(); | |
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