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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top