ParsePosition getIndex() method in Java with Example
The getIndex() method of java.text.ParsePosition class is used to retrieve the current parse position of this ParsePositon object .
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public int getIndex()
Parameter: This method does not accepts any argument as parameter.
Return Value: This method returns the current parse position of this parse position object.
Below are the examples to illustrate the getIndex() method:
current parse position: 1
current parse position: 3