I am using indexof() for finding a sub string. It finds my string if my string is not on first position, if my string is at the first location it won't work. Can any one suggest another way to find it?
Here is My Code:-
public class IndexOfStr {
public static void main(String args[]) {
String s = "Niraj";
System.out.println(s);
System.out.println("indexOf(niraj, 1) -> " + s.indexOf("niraj", 1));
}}
Output:-
Niraj indexOf(niraj, 1) -> -1
I am trying to to find the string in my Excel file.