Recursion to check if a String equals another string
<p>my current code returns the output:</p>

<pre><code>true
Expected: true

false
Expected: true

false
Expected: true

false
Expected: false

false
Expected: false 
</code></pre>

<p>So there's an issue with my logic that i'm not seeing</p>

<pre><code>public static void main(String[] args)
{

    System.out.println(find("",""));
    System.out.println("Expected: true\n");

    System.out.println(find("Mitten","Mit"));
    System.out.println("Expected: true\n");
    System.out.println(find("I love my CS courses!"," CS"));
    System.out.println("Expected: true\n");
    System.out.println(find("","Cookies."));
    System.out.println("Expected: false\n");
    System.out.println(find("Java","Python"));
    System.out.println("Expected: false\n");


}
public static boolean find(String text, String str)
{

    boolean found = false;
    if(text.length() == 0 &amp;&amp; str.length() == 0)
    {
        found = true;
        return found; 
    }
    if(text.length() == 0 || str.length() == 0)
    {
        return found; 
    }
    if(str.length() &gt; text.length())
    {
        return found;
    }
    if(str.equals(text.substring(0,str.length()-1))) 
    {
        found = true;   
    }
    else
    {
        text = text.substring(1);
        find(text, str);
    }
    return found;
}
</code></pre>

<p>please help</p>