Java Official Documentation Error?
I'm total a newbie to Java, but I think I found something wrong with the documentation concerning with methods coming with object String.
URL:String (Java 2 Platform SE v1.4.2)
The method I'm referring to is indexOf with parameters of a char and a int indicating the index of the char to start the search. It says:
" If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: -1 is returned."
Here I think it should be put:
" If it is greater than the length of this string minus 1, it has the same effect as if it were equal to the length of this string: -1 is returned."
Since the last char in the String is with index of length()-1, so if fromIndex=length()-1 there is a hope if the last one is just the prey. If it is greater than that, there is definitely no hope, as same as to equal to length. Greater than is definitely not greater or equal than, is it?:mad:
So did I put it correct? If I'm wrong at any point, please tell me. I found the index extremely recalcitrant, so I wish to tackle this problem.