Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Resolved
-
None
-
None
-
None
Description
The method
private static int ordinalIndexOf(final CharSequence str, final CharSequence searchStr, final int ordinal, final boolean lastIndex)
source
at the line
1028 index = CharSequenceUtils.indexOf(str, searchStr, index + searchStr.length());
is using as starting index for search the index+searchStr.length() .In case where the searchStr is a single character, the first run will start from index
-1+1 = 0
if the searchStr is long N, it will start at N-1 index and if str contains the searchStr before N-1 it will miss it