| Author |
Doubt in String delete function.
|
Rajesh Shinde
Greenhorn
Joined: Jan 29, 2010
Posts: 11
|
|
Hi,
Should this not give "StringIndexOutOfBoundsException", as the start index is 9 and s contains only 0-8 index values?
|
scjp6 processing.....
|
 |
appu sharma
Ranch Hand
Joined: Sep 20, 2009
Posts: 104
|
|
StringIndexOutOfBoundsException - if start is negative, greater than length(), or greater than end.
so your code not give exception becuse its length is 9
if you change it to
then you get StringIndexOutOfBoundsException
vinit
|
It doesn't matter if you win by an inch or a mile; winning's winning.
|
 |
Rajesh Shinde
Greenhorn
Joined: Jan 29, 2010
Posts: 11
|
|
Yes, This gives a exception as the start index is greater then String length.
I though it might throw exception if the start index is equal to the String length, as in that case also the String index is out of bound.(as there is no value at index=9)
|
 |
 |
|
|
subject: Doubt in String delete function.
|
|
|