value.Toint32() like value.ToString()

Hello here i will show you how can u create ur own function to convert data from string to int ....

We will do value.ToInt32() to convert string to Int.....just like we do value.ToSting() to convert to string........

public static class ConvertToInt
{
public static int Toint32(this string value)
{
return int.Parse(value);
}
}


after this u can use value.Toint32() insted of Convert.Toint32(value) ...
just like u use .ToString() for conversion

0 comments:

Post a Comment