Reg expression to check the decimal values

Posted by Nishithraj under C# category on | Views : 2825
We can check a variable is a decimal or not through the following code.

Regex objdecimal= new Regex(@"^[-+]?[0-9]*\.?[0-9]+$");


Return value will be true if it is a integer or decimal value.

Comments or Responses

Login to post response