Conversion

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have two string "False" and "0".
How can I convert them to a boolean and to an integer?

Thanks,
Miguel
 
I have two string "False" and "0".
How can I convert them to a boolean and to an integer?

bool blnTest = Convert.ToBoolean("False");
int intTest = Convert.ToInt32(blnTest);

However, "0" isn't recognised as a boolean, so you'll have to convert it to
an int first...
 
Back
Top