« HR Manager story | Sort based on input parameter in oracle query. »
IsNumeric() function in C#?
by Vahid 3. January 2009 05:36
hi,
as you may know c# is missing the nice and usfull IsNumeric function which is available in VB.net. but it is a trivial task to implement a generic equvelant function for it. look at the following code. it will return true if the value is numeric and false if the value is false.
static bool IsNumeric(object value)
{
double retNum;return Double.TryParse(Convert.ToString(value), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum);
}
Related posts
Comparision between C# and JAVA here is a quick comparision between microsoft c# (.net) and java …The C# Programming Language Version 4.0c# 4.0 by vahidLimitation in dbms_output.put_line in pl/sqlToday I was testing a function in pl/sql using pl/sql developer. In the function we are contenting s…
Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen