Skip to content

Tag Archives: Java-String-Programs

Given a String, the task is to convert this String into an IntStream containing the ASCII values of the characters as the elements. Examples: Input:… Read More
Given a String and a Word, the task is remove that Word from the String. Examples: Input: String = "Geeks For Geeks", Word = "For"… Read More
Given a String and an array of prefixes. The task is to check whether the given String starts with any of the given prefixes or… Read More
Given a list of characters, convert the list to a string. Input : list = {‘g’, ‘e’, ‘e’, ‘k’, ‘s’} Output : “geeks” Input :… Read More
The Java.util.List is a child interface of Collection. It is an ordered collection of objects in which duplicate values can be stored. Since List preserves… Read More
The Java.util.List is a child interface of Collection. It is an ordered collection of objects in which duplicate values can be stored. Since List preserves… Read More
Java Set is a part of java.util package and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can… Read More
String is a sequence of characters. In Java, objects of String are immutable which means they are constant and cannot be changed once created. Below… Read More
Java Set is a part of java.util package and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can… Read More
Given a string, the task is to check whether a string contains only alphabets or not using Regex in Java. Examples: Input: GeeksforGeeks Output: True… Read More
Given a String, the task is to check whether a string contains only alphabets or not. Examples: Input : GeeksforGeeks Output : True Input :… Read More
Given a string, the task is to check whether a string contains only alphabets or not using ASCII values in JAVA. Examples: Input : GeeksforGeeks… Read More
Given two strings s1 and s2, write a snippet to check whether s2 is a rotation of s1. Strings may contain duplicates. Examples: Input :… Read More
Given a string str, consisting of non-alphabetical characters. The task is to remove all those non-alphabetical characters of str and print the words on a… Read More
Before proceeding further with the fuss of immutability, let’s just take a look into the String class and its functionality a little before coming to… Read More