Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data type conversion 1

Status
Not open for further replies.

PavelGur

Programmer
Sep 21, 2001
75
I need to convert some data that I receive over Internet in String format to float and integer. So far I was not able to find conversion functions in C# help. I was looking for equivivalent of C++ atof and atoi but did not find them.
Thanks in advance, Pavel.
 

int num = Convert.ToInt32(string)
float num = Convert.ToFloat(string)

or
int num
bool CanConvert = int.TryParse(string, out num)
float num
bool CanConvert = float.TryParse(string, out num)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top