java.lang.StringIndexOutOfBoundsException

String index out of range: 4

Samebug tips1

Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web1226

  • via Unknown by Christophe Verré,
  • via Stack Overflow by random35
    ,
  • Stack trace

    • java.lang.StringIndexOutOfBoundsException: String index out of range: 4 at java.lang.String.charAt(String.java:558) at TestIndex.isGoodISBN(TestIndex.java:81) at TestIndex.main(TestIndex.java:27)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    rprp
    Once,
    zsambokizsamboki
    Once,
    poroszdporoszd
    14 times, last one
    Hiren AmaliyarHiren Amaliyar
    4 times, last one
    34 more bugmates