P
Patrik Malmström
Yes, how do I convert string to int?
Convert.Toint32(string)
Is there an advantage of using this over, say, Int32.Parse(string) or is it
just a matter of preferance?
But it doesn't return zero for an EMPTY string, like from a textbox.
For intstance...
Convert.ToInt32(textBox1.Text).ToString()
// rets emptystring if empty
Austin,Austin Ehlers said:Yep. You'll just have to do it like this:
if (textBox1.Text.ToString().Length==0)
//assign 0 to whatever
else //call convert