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
if it is a single string :
if (str.All(Char.IsDigit)) { // string contains only digits }
if it is a list of strings :
if (lstStr.All(s => s.All(Char.IsDigit))) { // List of strings contains only digits }