public static ToInt ( this str, int defVal ) : int | ||
str | this | |
defVal | int | |
Результат | int |
public static int ToInt(this string str, int defVal = 0)
{
int res;
return int.TryParse(str, out res) ? res : defVal;
}