Friday, February 6, 2009

string to integer in C#

Example

string str = "09";
int year = int.Parse(str) + 2000;

Output
year == 2009

1 comment:

inside said...

[int to string in C#]

int num = 10;
string str = Convert.ToStirng(num);