i've never encountered this problem before so i think it is a weird/unique instance. here i was fooling around with Strings in my code, and then i got this:
the code that created this is:
where thevalue = "alakazam" has been set earlier
i'm very sure it works for this are simple codes. i have no idea what the error is for, not how it comes about. anyone has any idea?
Code:
A: alakazam,
B: alakazam
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1480)
at StringLooper.insideCommand(DatabaseInvokerImpl.java:71)
at StringLooper.selectedCommand(DatabaseInvokerImpl.java:51)
at StringLooper.selectedCommand(DatabaseInvokerImpl.java:33)
at TestDummy.main(TestDummy.java:20)
Exception in thread "main"
the code that created this is:
Code:
.
System.out.println("A: "+thevalue);
thevalue = thevalue.substring(0,thevalue.length()-1);
System.out.println("B: "+thevalue);
.
i'm very sure it works for this are simple codes. i have no idea what the error is for, not how it comes about. anyone has any idea?