Finding index of a substring in Java
<p>I have a question. </p>

<p>Suppose we have two strings str1, str2. The strings can be anything. Now, we need to create a method which searches str1 for str2 and returns the index no. of the first occurrence of str2 in str1, and returns -1 if not found. But we cannot use string.indexOf method.</p>

<p>I am bumped as to how to do it.</p>

<p>Any help would be appreciated</p>

<p>Thanks</p>
