SyntaxFix
Write A Post
Hire A Developer
Questions
Very Clever and easy way to detect your string is contains only digits or not is this way:
string s = "12fg"; if(s.All(char.IsDigit)) { return true; // contains only digits } else { return false; // contains not only digits }