Write a Java program to reverse a given string with preserving the position of spaces? File: RemoveChar .java public class ReverseStringPreserveSpace {…
charAt()
-
-
How do you find duplicate characters in a string? Following program demonstrate it. File: DuplicateCharFinder .java import java.util.HashMap; import java.util.Map; import java.util.Set;…
- Java TechnologyJava Tutorial
Java program to find the percentage of uppercase, lowercase, digits and special characters in a String
Java program to find the percentage of uppercase, lowercase, digits and special characters in a string File: CharacterPercentage .java import java.text.DecimalFormat; public…
-
Write a code to check whether one string is a rotation of another? File: RotationString .java public class RotationString { public static…
-
Write a Java program to check whether two strings are anagram or not? Two strings are called anagrams if they contain same…
-
Write a Java program to count the number of words in a string? File: WordCount .java public class WordCount { static int…
-
How to check Palindrome String in Java We can check palindrome string by reversing string and checking whether it is equal to…
-
How to convert String to Integer and Integer to String in java Following is the program to demonstrate it. File: ConvertStringToInteger.java public…
-
How to optimize string creation? By using string literals. Ex: File: StringPerformance .java public class StringPerformance { public static void main(String[] args)…
-
How to remove a particular character from a string ? File: RemoveChar .java public class RemoveChar { public static void main(String[] args)…