Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# how do you check if a string contains only digits

if (str.All(char.IsDigit)) {
  Console.WriteLine("This string only contains numbers");
}
 
PREVIOUS NEXT
Tagged: #check #string #digits
ADD COMMENT
Topic
Name
2+1 =