convert a string to integer in c#.net
<p>I need to convert a string to integer. My string can be of any type (float/int/string/special Character).</p>

<p>For Example:</p>

<pre><code>If my string is "2.3", i need to convert to = 2
If my string is "anyCharacter", i need to convert to = 0
If my string is "2", i need to convert to = 2
</code></pre>

<p>I tried the following,</p>

<pre><code>string a = "1.25";int b = Convert.ToInt32(a);    
</code></pre>

<p>I got error "Input string was not in a correct format"</p>

<p>How to covert it? </p>
