Java String Last Index Of lastIndexOf(String text, int startPos, String... searchStrings)

Here you can find the source of lastIndexOf(String text, int startPos, String... searchStrings)

Description

last Index Of

License

Apache License

Declaration

public static int lastIndexOf(String text, int startPos, String... searchStrings) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int lastIndexOf(String text, int startPos, String... searchStrings) {
        int bestPos = -1;
        for (String i : searchStrings) {
            int pos = text.lastIndexOf(i, startPos);
            if (pos >= 0) {
                if ((bestPos < 0) || (pos > bestPos)) {
                    bestPos = pos;//from  ww w .  j  a  va  2s.  c  o m
                }
            }
        }
        return bestPos;
    }
}

Related

  1. lastIndexOf(String str, String searchChar)
  2. lastIndexOf(String str, String substr)
  3. lastIndexOf(String string, char value, int startIndex, int count)
  4. lastIndexOf(String string, char... chars)
  5. lastIndexOf(String string, String substring)
  6. lastIndexOf(String text, String key, int num)
  7. lastIndexOf(String what, String within)
  8. lastIndexOf(StringBuffer buf, String str)
  9. lastIndexOfAny(final String delimiters, final String str)