public static int lastIndexOfIgnoreCase(CharSequence str, CharSequence searchStr, int startPos) {
        if (str == null || searchStr == null) {
            return INDEX_NOT_FOUND;
        }
        if (startPos > str.length() - searchStr.length()) {
            startPos = str.length() - searchStr.length();
        }
        if (startPos < 0) {
            return INDEX_NOT_FOUND;
        }
        if (searchStr.length() == 0) {
            return startPos;
        }

        for (int i = startPos; i >= 0; i--) {
            if (CharSequenceUtils.regionMatches(str, true, i, searchStr, 0, searchStr.length())) {
                return i;
            }
        }
        return INDEX_NOT_FOUND;
    }
<p>Case in-sensitive find of the last index within a CharSequence
from the specified position.</p>

<p>A {@code null} CharSequence will return {@code -1}.
A negative start position returns {@code -1}.
An empty ("") search CharSequence always matches unless the start position is negative.
A start position greater than the string length searches the whole string.</p>

<pre>
StringUtils.lastIndexOfIgnoreCase(null, *, *)          = -1
StringUtils.lastIndexOfIgnoreCase(*, null, *)          = -1
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "A", 8)  = 7
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", 8)  = 5
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "AB", 8) = 4
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", 9)  = 5
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", -1) = -1
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "A", 0)  = 0
StringUtils.lastIndexOfIgnoreCase("aabaabaa", "B", 0)  = -1
</pre>

@param str  the CharSequence to check, may be null
@param searchStr  the CharSequence to find, may be null
@param startPos  the start position
@return the first index of the search CharSequence,
 -1 if no match or {@code null} input
@since 2.5
@since 3.0 Changed signature from lastIndexOfIgnoreCase(String, String, int) to lastIndexOfIgnoreCase(CharSequence, CharSequence, int)
android/android_framework/base/src/main/java/lang3/StringUtils.java