Check for Decimal using RegularExpressions.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under Visual Studio category on | Points: 40 | Views : 1375
Using System.Text.RegularExpressions;
public bool CheckForDecimal(string Param)
{
bool ResultVal = false;
Regex lrexRe = new Regex("[.]");
if (lrexRe.IsMatch(Param))
{
ResultVal = true;
}
return ResultVal;
}

bool i = CheckForDecimal("vishal.neeraj"); //true
bool j = CheckForDecimal("vishalneeraj"); //false

Comments or Responses

Login to post response