Here you can find the source of lastIndexOf(String str, String substr)
public static int lastIndexOf(String str, String substr)
//package com.java2s; //License from project: Open Source License public class Main { public static int lastIndexOf(String str, String substr) { if (str != null) { return str.lastIndexOf(substr); } else {/*from w w w . j av a 2 s . co m*/ return -1; } } public static int lastIndexOf(String str, String substr, int ix) { if (str != null) { return str.lastIndexOf(substr, ix); } else { return -1; } } }