Here you can find the source of lastIndexOfAny(String str, char[] targets)
public static int lastIndexOfAny(String str, char[] targets)
//package com.java2s; //License from project: Apache License public class Main { public static int lastIndexOfAny(String str, char[] targets) { int result = -1; for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); for (char target : targets) { if (ch == target) { result = i;//from w w w . j av a 2 s . c om break; } } } return result; } }