java.lang.String class has a method called substring, that is very useful in parsing operations. You need to know the starting and ending index of text in a String object to make use of substring method.

Review following example. We want to get text from the last index of "-" till the end of string.

Java Code:
String str = "Country-France-Captal-Paris";
int index = str.lastIndexOf("-");
System.out.println("Capital:" + str.substring(index+1,str.length()));
Output:
Java Code:
Capital:Paris