how to check if a string value is an integer in c# code example Example: c# see if string is int bool result = int.TryParse("123", out var n);