Hello, please take a look at this code:
1 class strings
2 {
3 public static void main(
String arg[])
4 {
5 if("String".indexOf("S",-10) ==0)
6 {
7 System.out.println("Equal");
8 }
9 else
10 {
11 System.out.println("Not Equal");
12 }
13 }
14 }
What does the indexOf method do, how do we use it, and how does the above code work?
Thank You,
Kamil