In this section, you will get the detailed explanation about the
substring(int beginIndex, int endIndex) method of
String class. We are going to use substring(int beginIndex,
int endIndex) method of String class in Java. The description of the code is given below for the usage of the method.
Description of the code:
Here, you will get to know about the substring(int beginIndex, int endIndex) method through the following java program. In the program code given below, we have taken a String. To find a substring from the specified string, we have applied substring(int beginIndex, int endIndex) method and then we have passed the index numbers to that to find the specified substring from the beginning and the end of the index numbers as shown in the output.
NOTE: This method returns a new string from the specified string that is a substring of it.
Here is the code of the program:
Output of the program:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: August 21, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles