Invalid token 'return' in class, struct, or interface member declaration
<pre><code>return found;
</code></pre>

<p>is giving: </p>

<pre><code>Invalid token 'return' in class, struct, or interface member declaration
</code></pre>

<p>Code:</p>

<pre><code>public bool IsTextPresent(ISelenium Selenium, string searchText)
    {

        int count = (int)Selenium.GetXpathCount("//*[@id='resultTable']/table");
        string text;

        bool found;

        for (int i = 1; i &lt;= count; i++) 
        {
            StringBuilder container = new StringBuilder();

            for (int j = 4; j &lt;= 8; j += 2)
            {

                if (Selenium.IsElementPresent("xpath=/html/body/form/div[2]/table[" + (i) + "]/tr[" + (j) + "]/td[4]"))
                {
                    text = Selenium.GetText("xpath=/html/body/form/div[2]/table[" + (i) + "]/tr[" + (j) + "]/td[4]");


                    container.Append(text + Environment.NewLine);
                }

                string fullText = container.ToString();
                    if (!fullText.Contains(searchText))
                    {
                        found = false;
                    }
                    else
                    {
                        found =  true;
                    }
                }
            }
        }
        return found;            
    }
</code></pre>
