In C#, how to check whether a string contains an integer?
You could use char.IsDigit: bool isIntString = “your string”.All(char.IsDigit) Will return true if the string is a number bool containsInt = “your string”.Any(char.IsDigit) Will return true if the string contains a digit