@@ -0,0 +1,799 @@
+import java.util.Scanner;%0A%0Apublic class substring_last_index %7B%0A%09public static void main(String%5B%5D args) %7B%0A%09%09//directions and gather user input%0A%09%09Scanner s = new Scanner(System.in);%0A%09%09System.out.println(%22Enter the string you wish to search%22);%0A%09%09String given_string = s.nextLine();%0A%09%09System.out.println(%22Enter the substring you wish to find the beginning of%22);%0A%09%09String substring = s.nextLine();%0A%09%09s.close();%0A%09%09%0A%09%09//calculate index of last substring%0A%09%09int index = given_string.lastIndexOf(substring);%0A%09%09%0A%09%09//print result%0A%09%09if(index %3C 0 ) %7B%0A%09%09%09System.out.println(%22The substring you requested was not found within the search string%22);%0A%09%09%7D else %7B%0A%09%09%09System.out.println(%22The substring %5C%22%22 + substring + %22%5C%22 was found at index %22 + index + %0A%09%09%09%09%09   %22 of the given string %5C%22%22 + given_string + %22%5C%22%22);%0A%09%09%7D%0A%09%7D%0A%7D%0A

finds the beginning index of a given substring in a given string