In C#.NET we don’t have IsNumeric function; to achieve same functionality as IsNumeric in C# we can make use of Double.TryParse. Please find following example how we can achieve this
double db;
string strInput = "SomeValue";
if (double.TryParse(strInput, out db))
{
Response.Write(db.ToString());
}
else
{
Response.Write("Not a number");
}
Hope this helps.
Tag: IsNumeric in C#, .NET
Wednesday, April 8, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment