Hi All,
I have an value in string ,and i want to check it is null, empty or zero.
so,when string is null or empty that time I use string.IsNullorEmpty(Variablename)
but, for zero checking I am getting error.
kindly, suggest me
Hi
String.Isnullorempty method will check only for null value or empty
while zero is different from null
for zero it should be like StringVariable.ToString.Equals(“0”)
Kindly try this and let know for any queries or clarification or
if we want both together to be validated
then string.IsNullorEmpty(yourvariable) or yourvariable.ToString.Equals(“0”)
To check null in JavaScript, use triple equals operator(===) or Object.is() method. To find the difference between null and undefined, use the triple equality operator or Object.is() method.
To loosely check if the variable is null, use a double equality operator(==). The double equality operator can not tell the difference between null and undefined, so it counts as same. So if you want to strict check, then don’t use a double equality operator. It will lead to misconclusion.