Monday, March 15, 2010

Convert String to integer

int i = Convert.ToInt32(str);

int i = int.Parse(str);

int i;
int.TryParse(str, out i);

But for the third method, i cannot be property. It will come out an error:
A property or indexer may not be passed as an out or ref parameter.

No comments: