hello once again... i have a problem with my indexOf method.... i dont know why... it said in the API i can use it with the util. package.. but it doesn't run... can anyone help me please???
its at line 67...
codecodecode:
Momo Sawada wrote:at line 67... i tried using it to get the index of the found element and replacing it with another in the same index....
on line 67, you CALL the indexOf() method, not declare it. If you call a method by simply typing the name, Java assumes you are trying to call a method defined in the current class. If you are trying to call the String class' indexOf method, you need to call it on a specific String.
What String is your 'r' supposed to be a substring of? you would need to change 67 to something like
int indx=myString.indexOf(r);
and replace 'myString' with whatever String you are searching.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors