public static int lastOrdinalIndexOf(CharSequence str, CharSequence searchStr, int ordinal) {
        return ordinalIndexOf(str, searchStr, ordinal, true);
    }
<p>Finds the n-th last index within a String, handling {@code null}.
This method uses {@link String#lastIndexOf(String)}.</p>

<p>A {@code null} String will return {@code -1}.</p>

<pre>
StringUtils.lastOrdinalIndexOf(null, *, *)          = -1
StringUtils.lastOrdinalIndexOf(*, null, *)          = -1
StringUtils.lastOrdinalIndexOf("", "", *)           = 0
StringUtils.lastOrdinalIndexOf("aabaabaa", "a", 1)  = 7
StringUtils.lastOrdinalIndexOf("aabaabaa", "a", 2)  = 6
StringUtils.lastOrdinalIndexOf("aabaabaa", "b", 1)  = 5
StringUtils.lastOrdinalIndexOf("aabaabaa", "b", 2)  = 2
StringUtils.lastOrdinalIndexOf("aabaabaa", "ab", 1) = 4
StringUtils.lastOrdinalIndexOf("aabaabaa", "ab", 2) = 1
StringUtils.lastOrdinalIndexOf("aabaabaa", "", 1)   = 8
StringUtils.lastOrdinalIndexOf("aabaabaa", "", 2)   = 8
</pre>

<p>Note that 'tail(CharSequence str, int n)' may be implemented as: </p>

<pre>
  str.substring(lastOrdinalIndexOf(str, "\n", n) + 1)
</pre>

@param str  the CharSequence to check, may be null
@param searchStr  the CharSequence to find, may be null
@param ordinal  the n-th last {@code searchStr} to find
@return the n-th last index of the search CharSequence,
 {@code -1} ({@code INDEX_NOT_FOUND}) if no match or {@code null} string input
@since 2.5
@since 3.0 Changed signature from lastOrdinalIndexOf(String, String, int) to lastOrdinalIndexOf(CharSequence, CharSequence, int)
android/android_framework/base/src/main/java/lang3/StringUtils.java