Here you can find the source of lastIndexOfAny(String str, String[] searchStrs)
public static int lastIndexOfAny(String str, String[] searchStrs)
//package com.java2s; public class Main { public static int lastIndexOfAny(String str, String[] searchStrs) { if ((str == null) || (searchStrs == null)) { return -1; }//from w w w . j av a 2 s . c o m int searchStrsLength = searchStrs.length; int index = -1; int tmp = 0; for (int i = 0; i < searchStrsLength; i++) { String search = searchStrs[i]; if (search == null) { continue; } tmp = str.lastIndexOf(search); if (tmp > index) { index = tmp; } } return index; } public static int lastIndexOf(String str, char searchChar) { if ((str == null) || (str.length() == 0)) { return -1; } return str.lastIndexOf(searchChar); } public static int lastIndexOf(String str, char searchChar, int startPos) { if ((str == null) || (str.length() == 0)) { return -1; } return str.lastIndexOf(searchChar, startPos); } public static int lastIndexOf(String str, String searchStr) { if ((str == null) || (searchStr == null)) { return -1; } return str.lastIndexOf(searchStr); } public static int lastIndexOf(String str, String searchStr, int startPos) { if ((str == null) || (searchStr == null)) { return -1; } return str.lastIndexOf(searchStr, startPos); } }