string is numeric or not

Posted by Senthilns2005 under C# on 6/7/2011 | Points: 10 | Views : 1523 | Status : [Member] | Replies : 2
Find Given Input String Or Numeric ?

Ex

if string is 1111111111 returns true
if string is 11111111aa returns false

Regards
N.Senthilkumar



Responses

Posted by: Gsolvers on: 6/7/2011 [Member] Starter | Points: 25

Up
0
Down
you can use the below

int.Parse("1111");


the above method converts a string to integer if it is valid. You can use this to satisfy your requirement. Let me know if you need the complete code.

Best Regards,

VG
www.TeacherJi.com

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

Posted by: Karthikanbarasan on: 6/7/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Check this code snippet, exactly wot you wanted

http://www.codeproject.com/KB/cs/IsNumeric.aspx

Thanks
Karthik
www.f5Debug.net

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

Login to post response