check if a string contains integer c# code example
Example 1: if string contains number c#
"abc3def".Any(c => char.IsDigit(c));
// Or to make it shorter:
"abc3def".Any(char.IsDigit);
Example 2: c# see if string is int
bool result = int.TryParse("123", out var n);