get substring java example

substring() Extract Part of a String

Here, we use the overloaded methods of substring() to extract the whole or a part of a string. Following is the signature of overloaded substring() method as defined in String class. String substring(int indexNum): Returns a string containing all the characters existing from indexNum to the end in the given…