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
startWith() method of String class present in java.lang package is used to check whether the string starts with a specific prefix. The package view is… 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
Strings in Java are objects that are supported internally by a char array. Since arrays are immutable, and strings are also a type of exceptional… 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
getBytes() encodes a string into a sequence of bytes using the named character set and storing the result into a new byte array. This function… 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 stored… 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

Start Your Coding Journey Now!