about data type convert

  • Thread starter Thread starter authorking
  • Start date Start date
You want to use int.Parse(string);

e.g.

string s = "12345";
int i = int.Parse(s);
 
Hi,

Int.Parse() will rise an exception if the string parameter is not
convertible to an integer, you will have to wrap it on a try/catch

cheers,
 

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

Back
Top