How can I convert a string to int?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1019793/how-can-i-convert-string-to-int">How can I convert String to Int?</a>  </p>
</blockquote>



<pre><code>public List&lt;int&gt; GetListIntKey(int keys)
{
        int j;
        List&lt;int&gt; t;
        t = new List&lt;int&gt;();
        int i;
        for (i = 0; ; i++)
        {
            j = GetKey((keys + i).ToString());
            if (j == null)
            {
                break;
            }
            else
            {
                t.Add(j);
            }
        }
        if (t.Count == 0)
            return null;
        else
            return t;
}
</code></pre>

<p>The problem is on the line: </p>

<pre><code>j = GetKey((keys + i).ToString());
</code></pre>

<p>I'm getting error say: </p>

<blockquote>
  <p>Cannot implicitly convert type 'string' to 'int'</p>
</blockquote>

<p>Now the <code>GetKey</code> function is type of string:</p>

<pre><code>public string GetKey(string key)
{
}
</code></pre>

<p>What should I do ?</p>
