Skip to content

Tag Archives: Java-Strings

array.length: length is a final variable applicable for arrays. With the help of the length variable, we can obtain the size of the array.  string.length()… Read More
String class doesn’t have any method that directly sorts a string, but we can sort a string by applying other methods one after other. String… Read More
Java.lang.String class in Java | Set 1 In this article we would be discussing different constructor and methods provided by java.lang.String. Strings in java are… Read More
There are two variants of startswith() method.This article depicts about all of them, as follows: 1. String startsWith() : This method tests if a string… Read More
There are two variants of the substring() method. This article depicts all of them, as follows :  1. String substring(): This method has two variants… Read More
Variants of matches() method is used to tell more precisely not test whether the given string matches to a regular expression or not as whenever… Read More
Here are three variants of replace() method.This article depicts about all of them ,as follows: 1. String replace() : This method returns a new string… Read More
There are four variants of indexOf() method. This article depicts about all of them, as follows: 1.int indexOf() : This method returns the index within this… Read More
There are four variants of lastIndexOf() method.This article depicts about all of them, as follows: 1. lastIndexOf() : This method returns the index of the… Read More
Sorting a collection of objects can be done in two ways:  By implementing Comparable (Natural Order) e.g. Strings are sorted ASCIIbetically. meaning B comes before… Read More
Let’s see an approach to reverse words of a given String in Java without using any of the String library function Examples: Input : "Welcome… Read More
As we know that Object of String in Java are immutable (i.e. we cannot perform any changes once its created). To do modifications on string… Read More
In Set 1, we have discussed general approach to check whether a string is a valid number or not. In this post, we will discuss… Read More
Given a string, extract the first letter of each word in it. “Words” are defined as contiguous strings of alphabetic characters i.e. any upper or… Read More
Write a function that takes a String as an argument and prints all unique words in it. Examples: Input : Java is great. Grails is… Read More

Start Your Coding Journey Now!