Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8302590 Add String.indexOf(int ch, int fromIndex, int toIndex)
  3. JDK-8315399

Release Note: New `String` `indexOf(int,int,int)` and `indexOf(String,int,int)` Methods to Support a Range of Indices

    XMLWordPrintable

Details

    • In Review
    • 21

    Description

      Two new methods `indexOf(int ch, int beginIndex, int endIndex)` and `indexOf(String str, int beginIndex, int endIndex)` are added to `java.lang.String` to support forward searches of character `ch`, and of `String` `str`, respectively, and limited to the specified range of indices.

      Besides full control on the search range, they are safer to use than `indexOf(int ch, int fromIndex)` and `indexOf(String str, int fromIndex)`, respectively, because they throw an exception on illegal search ranges.

      Method `indexOf(int ch, int beginIndex, int endIndex)` is covered by JDK-8302590, and method `indexOf(String str, int beginIndex, int endIndex) is covered by JDK-8303648.

      Attachments

        Issue Links

          Activity

            People

              rgiulietti Raffaello Giulietti
              rgiulietti Raffaello Giulietti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: