Skip to content

Tag Archives: Java-String-Programs

Given a String, the task it to split the String into a number of substrings. A String in java can be of 0 or more… Read More
Figure a way out to print all the strings that match a given pattern from a file. To get closer to the goal, concepts of… Read More
Given an integer n and character ch, return a String using the character as thousands separator on the given number. Examples: Input: n=1234 , ch… Read More
The Stack is a linear data structure that follows the LIFO(Last In First Out) principle, i.e, the element inserted at the last is the element… Read More
The regionMatches() method has two variants which can be used to test if two string regions are matching or equal. Syntax: Case sensitive test method:… Read More
Given string str of length N, the task is to remove uppercase, lowercase, special, numeric, and non-numeric characters from this string and print the string… Read More
Given string str of length N, the task is to check if the given string contains only special characters or not. If the string contains… Read More
Given string str of length N, the task is to check whether the given string contains uppercase alphabets, lowercase alphabets, special characters, and numeric values… Read More
Given string str, the task is to write a Java program to swap the pairs of characters of a string. If the string contains an… Read More
Given a string str and a positive integer k, the task is to write a Java program to print the first k characters of the… Read More
Given string str, the task is to print the middle character of a string. If the length of the string is even, then there would… Read More
Given string str, the task is to write Java Program check whether the given string is a pangram or not. A string is a pangram… Read More
Given string str, the task is to write a Java program to swap the first and the last character of the given string and print… Read More
Given string str, the task is to write Java Program to remove the first and the last character of the string and print the modified… Read More
Given a string in Snake Case, the task is to write a Java program to convert the given string from snake case to camel case… Read More