public static class ExtensionString
{
public static int ToInt(this string str)
{
int ret = 0;
if (str != null && str.Length > 0)
{
str = str.Replace(",", string.Empty);
int.TryParse(str, out ret);
}
return ret;
}
}
public static int ToInt(this string str) //this 关键字的作用.
{
public static int ToInt(this string str)
{
int ret = 0;
if (str != null && str.Length > 0)
{
str = str.Replace(",", string.Empty);
int.TryParse(str, out ret);
}
return ret;
}
}
public static int ToInt(this string str) //this 关键字的作用.