I have value as belowbelow
string value = "10053409434400003333336533210923";
When I try to parse below it isNumeric displays always false result because of long (i think)
long n;
bool isNumeric = long.TryParse(value , out n);
if (!isNumeric) // Always false
{
}
Where I miss in code how can I check string (even 50 characters) value is numeric or not ?
Thanks
stringtolongwhich returnsfalsebecause your value is too big forlongtype. Your question says; how can I check string value is numeric which I guess you try to check every character is numeric or not which is already have a question. Can you please clarify your question?int xtostringand test itsLenghto see ifx > 9 && x < 100. Correct approach is given by @AlexD answer.