Java String Last Index Of lastIndexOfAny(final String delimiters, final String str)

Here you can find the source of lastIndexOfAny(final String delimiters, final String str)

Description

last Index Of Any

License

Apache License

Declaration

public static int lastIndexOfAny(final String delimiters, final String str) 

Method Source Code

//package com.java2s;
/*// ww  w  .  jav a  2 s .  c  om
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You should have received a copy of  the license along with this library.
 * You may also obtain a copy of the License at
 *         http://www.apache.org/licenses/LICENSE-2.0.
 */

public class Main {
    public static int lastIndexOfAny(final String delimiters, final String str) {
        for (int i = str.length() - 1; i >= 0; --i) {
            if (delimiters.indexOf(str.charAt(i)) >= 0) {
                return i;
            }
        }
        return -1;
    }
}

Related

  1. lastIndexOf(String string, String substring)
  2. lastIndexOf(String text, int startPos, String... searchStrings)
  3. lastIndexOf(String text, String key, int num)
  4. lastIndexOf(String what, String within)
  5. lastIndexOf(StringBuffer buf, String str)
  6. lastIndexOfAny(String str, String search, int offset)
  7. lastIndexOfAnyBut(String srcString, String validString)
  8. lastIndexOfAnyDelimiter(String str, int fromIndex, String delimiters)
  9. lastIndexOfIgnoreCase(String pString, String pLookFor)