I know a few ways how to check this. regex,int.parse,tryparse,looping.
int.parse
tryparse
can anyone tell me what is the fastest way to check?
the nee
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 }