How to Use Indexof()method in java
<p>I am using <code>indexof()</code> 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?</p>

<p>Here is My Code:-</p>

<pre><code>public class IndexOfStr {


  public static void main(String args[]) {
  String s = "Niraj";
  System.out.println(s);
  System.out.println("indexOf(niraj, 1) -&gt; " + s.indexOf("niraj", 1));


 }}
</code></pre>

<p><strong>Output:-</strong></p>

<pre><code>Niraj indexOf(niraj, 1) -&gt; -1
</code></pre>

<p>I am trying to to find the string in my Excel file.</p>
