Home » FAQ » WinForms » from MFC » How do I convert a string to a double or int? What plays the role of atof and atoi in C#
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);
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with