Tuesday, 6 September 2011

How to check string value is number or not

Hi friends there are the simple javascript method for this
string number = "100";
if (number.All(Char.IsDigit))
{
Console.Write("{0} is a valid number!", number);
}
else
{
Console.Write("{0} is not a valid number!", number);
 } 
 ----------------------------------------------------------
Hope this will help you 
thanks 
Rohit Srivastava

No comments:

Post a Comment