Beyond the last character of the substring : Extracting String Characters « Data Type « Java Tutorial






public class MainClass{

  public static void main(String[] arg){
    String place = "abcedfghijk";
    String segment = place.substring(7, 11);

    System.out.println(segment);
  }

}
hijk








2.25.Extracting String Characters
2.25.1.Searching Strings for Characters
2.25.2.Finding the last occurrence of 'a' in the String variable text: the method lastIndexOf()
2.25.3.To search forwards from a given position: startIndex
2.25.4.Searching for Substrings
2.25.5.Last index of
2.25.6.Up to the end of the string
2.25.7.Beyond the last character of the substring
2.25.8.String Characters