Hi All

I have a small program which has 2 variables(1 string
variable and other an integer variable). I have to
convert the value in the string variable to an integer
and store it in the integer variable. Before
converting it into an integer I want to check whether
the string varibale contains valid numbers if so, I
would go ahead and convert otherwise I have to store
0.

Here is the code I am tryin to get it work.

string str1 = "M3300";
int val = 0;
if(str1!= "")
        val = Convert.ToInt32(strReason3);
else
        val = 0;

Any help appreciated.
Thanks
Nischal

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to