java - data - Substring method desc needs to be clarified

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 6-pool
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: