Finding Substrings
String s1 = “All the King’s Horses”;
s1.indexOf((int) 'K'); // 8
s1.indexOf("the"); // 4
s1.substring(8); // “King’s Horses”
s1.substring(8,4); // “King”
Previous slide
Next slide
Back to first slide
View graphic version