get the substring in java code example
Example 1: java substring
String s = "Let's Get This Bread";
String subString = s.substring(6, 9);
// (start index inclusive, end index exclusive)
// subString == "Get"
Example 2: java get substring
// substring(int begin, int end)
String n = "hello there general kenobi";
System.out.println(n.substring(6, 11));
// -> "there"