check number of digits in string C# code example
Example: c# how do you check if a string contains only digits
if (str.All(char.IsDigit)) {
Console.WriteLine("This string only contains numbers");
}
if (str.All(char.IsDigit)) {
Console.WriteLine("This string only contains numbers");
}