Showing posts with label check for string. Show all posts
Showing posts with label check for string. Show all posts

24 October 2011

check whether the given value is string or not

public static bool IsNumeric(String strVal)
{
Regex reg = new Regex("[^0-9-]");
Regex reg2 = new Regex("^-[0-9]+$|^[0-9]+$");
return (!reg.IsMatch(strVal) && reg2.IsMatch(strVal));
}
-----------------------------

isNaN(objnumber)