RFR: 8302590: Add String.indexOf(int ch, int fromIndex, int toIndex) [v2]

Raffaello Giulietti rgiulietti at openjdk.org
Tue Feb 28 13:33:05 UTC 2023


On Fri, 24 Feb 2023 17:45:23 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Add an `indexOf()` variant allowing to specify both a lower and an upper bound on the search.
>
> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8302590: Add String.indexOf(int ch, int fromIndex, int toIndex)

Added a `checkedIndexOf(int ch, int fromIndex, int toIndex)` variant that throws if
`0 <= fromIndex <= toIndex <= this.length()`
is not met.
Otherwise it behaves like `indexOf(int ch, int fromIndex, int toIndex)`.

-------------

PR: https://git.openjdk.org/jdk/pull/12600


More information about the core-libs-dev mailing list