Techie Talks

Sunday, February 13, 2005

Some essential Type convertions in C#

To convert from numerical datatypes like int, short, float, double etc., to string, use the ToString method of the numerical classes.

Eg:-

int x = 10;
String S = x.ToString();

To convert string to numerical datatypes, use each class's Parse function.

Eg:-

String S = System.Int32.Parse("10");

0 Comments:

Post a Comment

<< Home