In a program that searches multiples strings for a certain set of characters (substring) and returns the index of that substring, I get this StringOutOfBoundException. I'm using String.index() and it works for about 25 iterations then I get this error. What am I not doing?
Tom Purl
Ranch Hand
Joined: May 24, 2002
Posts: 104
posted
0
It would help tremendously if you would post a portion of your code. Thanks!
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.
Are you sure that you aren't trying to search a String beyond it's length? Are you getting any ideas?