substring in ja 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: substring
const str = 'Mozilla';
console.log(str.substring(1, 3));
// expected output: "oz"
console.log(str.substring(2));
// expected output: "zilla"