+ 1
What is indexof() method
what is indexof() method describe
3 Respuestas
+ 6
indexOf method is mainly an array method ( wich return the first index item corresponding )...
As strings can be considered as arrays of characters, the indexOf method can also be applied on it as explained by @Nikhil Kumar ;)
+ 4
indexOf() method is used to return the first occurrence of the character that is passed in as an argument.
Eg: String str = "Nikhil";
int i = str.indexOf ('i');
SOPln (i);
output will be 1.
note: counting is zero indexed based.
0
hello nikhil I don't understand indexof() method please explain more example