Converts the string to an int, returning true if successful.
문법
int.TryParse(s, out result)예제
아래 값을 입력하면 예제에 즉시 반영됩니다.
if→TryParse→out→result→Console→WriteLine→bad→if (int.TryParse("42", out int result))
Console.WriteLine(result); // 42
if (!int.TryParse("abc", out int bad))
Console.WriteLine("Parse failed");