java.lang.StringIndexOutOfBoundsException

String ind ex out of range: 1

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.

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

Solutions on the web4552

  • via Oracle Community by 807599, 8 months ago
    String ind ex out of range: -1
  • via Oracle Community by 807549, 10 months ago
    String ind ex out of range: -1
  • String ind ex out of range: -1
  • Stack trace

    • java.lang.StringIndexOutOfBoundsException: String ind ex out of range: 1 at java.lang.String.charAt(String.java:695) at test.countUppercase(test.java:24) at test.main(test.java:10)

    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

    Once, 1 week ago
    Once, 1 week ago
    14 times, 2 weeks ago
    4 times, 2 weeks ago
    Once, 3 weeks ago
    34 more bugmates