Checking the string is no or string

Posted by Fundaravi under C# on 4/13/2012 | Points: 10 | Views : 790 | Status : [Member] | Replies : 2
ABCD6219 check given string is number or not? give me cod in c#.Net

Ravindra


Responses

Posted by: Sakthi.Singaravel on: 4/13/2012 [Member] Silver | Points: 25

Up
0
Down
hi ravindra,

ur requirement is the given contains number or not...?

(or)

the given string only number or not..?

Regards,
Singaravel M

Fundaravi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somasundaram on: 4/14/2012 [Member] Starter | Points: 25

Up
0
Down
string s = "ABCD6219";
Int32 a;
if (Int32.TryParse(s, out a))
{
// Value is numberic
}
else
{
//Not a valid number
}

Fundaravi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response