Answers for "check decimal if is null C#"

C#
0

check decimal if is null C#

if (DecimalVariable.Equals(null))  
{
   //something statements
}
Posted by: Guest on September-24-2021
-2

c# check if int is null

// When trying to check if your int is null or i.e. 'not set',
// you will get the following error:

// The result of the expression is always 'false'
// since a value of type 'int' is never equal to 'null' of type 'int?'

// You can however bypass this by converting your int to string:
int myInt = null;
// This Method will return a bool;
bool isNullInt = string.IsNullOrEmpty(myInt.ToString());
// isNullInt will be in this case true
Posted by: Guest on October-01-2020

C# Answers by Framework

Browse Popular Code Answers by Language