How do I convert a string to a double or int? What plays the role of atof and atoi in C#

Platform: WinForms| Category: from MFC

You use static members of the Convert class found in the System namespace to handle conversions in the .NET framework.

	string s = '45';
	int h = Convert.ToInt32(s);
	double d = Convert.ToDouble(s);

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.