string s1 = "123";
string s2 = "abc";
bool isNumber = int.TryParse(s1, out int n); // returns true
isNumber = int.TryParse(s2, out int n); // returns false
if (str.All(char.IsDigit)) {
// String only contains numbers
}
bool result = int.TryParse("123", out var n);
var isNumeric = int.TryParse("123", out int n);