ConvertToInt32("10")
int i = Convert.ToInt32(null);
It can handle null values. If you run the above line you will get 0 in i variable.
int.Parse("10")
int i = int.Parse(null);
It cannot handle null. You will get this error Value cannot be null. Parameter name: String.
(int) "10"
You cannot directly convert string into int.
But you can convert double, float and decimal values like this
In this below line you will get 10 only.
double s = 10.3;
int i = (int)s;
int.TryParse("10")
The above code line is not correct. It has to be written this way
int i;
int.TryParse("s", out i);
int value = i;
You will get 0 in variable value because s is not an integer value.
This above code will prevent us from error like input string is not in a correct format.