Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6992616

java - data - Substring method desc needs to be clarified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 6-pool
    • docs
    • b05
    • generic
    • generic
    • Verified

      The explanation of substring(int beginIndex, int endIndex) seems to be confusing.

      There is a typo in the description of String substring(int beginIndex, int endIndex).

      URL: http://download.oracle.com/javase/tutorial/java/data/manipstrings.html

      Description:
      Returns a new string that is a substring of this string. The first integer argument specifies the index of the first character. The second integer argument is the index of the last character + 1.

      - It should be "last character - 1".

      - Or in a form more easy to understand (from your 1.4.2 docs):

      Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.

            santhoshla Santhosh La (Inactive)
            skannan Sowmya Kannan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: