java.lang.StringIndexOutOfBoundsException: String index out of range: 21835

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.

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.


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

  • Couting words/sentences in a jTextArea
    via by 807577,
  • loops
    via by Paul Baker,
  • Fastscroll crash
    via GitHub by adrian-bl
  • CLOB in BI Publisher Reports
    via by Guest_0607,
    • java.lang.StringIndexOutOfBoundsException: String index out of range: 21835 at java.lang.String.charAt( at pda.MainView.BTNRunTest_actionPerformed( at pda.MainView$5.actionPerformed( at javax.swing.AbstractButton.fireActionPerformed( at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed( at javax.swing.DefaultButtonModel.fireActionPerformed( at javax.swing.DefaultButtonModel.setPressed( at javax.swing.plaf.basic.BasicButtonListener.mouseReleased( at java.awt.Component.processMouseEvent( at java.awt.Component.processEvent( at java.awt.Container.processEvent( at java.awt.Component.dispatchEventImpl( at java.awt.Container.dispatchEventImpl( at java.awt.Component.dispatchEvent( at java.awt.LightweightDispatcher.retargetMouseEvent( at java.awt.LightweightDispatcher.processMouseEvent( at java.awt.LightweightDispatcher.dispatchEvent( at java.awt.Container.dispatchEventImpl( at java.awt.Window.dispatchEventImpl( at java.awt.Component.dispatchEvent( at java.awt.EventQueue.dispatchEvent( at java.awt.EventDispatchThread.pumpOneEventForHierarchy( at java.awt.EventDispatchThread.pumpEventsForHierarchy( at java.awt.EventDispatchThread.pumpEvents( at

    Users with the same issue

    poroszd12 times, last one,
    olle.hallin1 times, last one,
    linxiaolong1 times, last one,
    jokester1 times, last one,
    tyson9251 times, last one,
    30 more bugmates