int d = 0;
if(int.TryParse("123", out d) == false)
{
Console.WriteLine("false");
}
else
{
Console.WriteLine("true");
}
You can use int.Parse instead of int.TryParse.
But, if you use int.Parse instead of int.TryParse, throw exception.
댓글 없음:
댓글 쓰기