Tag

#java string program

17 posts

Java Program to Remove all the Vowels from a String

This post shows, How to remove all vowels from a string in java? with the help of replaceAll() method. Remove vowels from a string in java: Explanation:Removing vowels in java is easy, we will take the user input with the help of a Scanner class. we will use replaceAll() which takes in two para

June 12, 2026Read more →

Java Program to Count Total Character in a String

In this tutorial, we will see how to Count Total Characters in a String in java. The program below counts the number of letters present in the sentence (String) and displays the total character present in number. The program checks for spaces present in the Strings and if gets space while checking e

March 21, 2021Read more →

Java Program to Find the Frequency of a Character

In this tutorial, we will write a program to calculate the frequency of Characters present in a String in java. Frequency refers to the number of times that have occurred. In this program, we will count how many times each character is repeated in a String and display the result for each word’

March 21, 2021Read more →

Java Program to Find a Frequency of Words

In this tutorial, we will see how to calculate the frequency of words present in a String in java. Frequency refers to the number of times that have occurred. In this program, we will count how many time each word are repeated and display the result for each word’s frequency. The program split

March 21, 2021Read more →

Java Program to Check if the String is empty or not

In this tutorial, we will write a java program to check whether the string is empty or not. The strings are defined in the program and it is passed to the method as an argument. After checking for null and empty (built-in empty() function is used), a true or false value is returned accordingly. And

March 20, 2021Read more →

Java Program for user String Input

It is a simple demonstration to show how to take a string as an input from the user. The only thing you need to be concerned about is the data type that you declare in the program that is the String data type as shown below in the program. String in java How to take … Read more

March 20, 2021Read more →

Java Program to Count Letters in a String

In this tutorial to Count Letters in a String in java, we will see two examples to count the number of letters present in a String in Java. The first one, where the String is already defined in a program. The second one, where the String is taken as input from the user Both the … Read more

March 20, 2021Read more →