isnull in C#

  • Thread starter Thread starter ReidarT
  • Start date Start date
if (string = null) //Doesn't this assign null to string?
if (string == null) //This is what you want, to check if string is null

Chris
 
I used the code as follows as it worked.
Note, c# is case-sensitive :-)
if (child == null)
{
strError = "Some Error";
return false;
}
 
if (string = null) //Doesn't this assign null to string?
if (string == null) //This is what you want, to check if string is null

Yup, still trying to juggle Delphi and C# :-)) Would you believe, I used to
do C++ until about 10 years ago?

Joanna
 
Yup, still trying to juggle Delphi and C# :-)) Would you believe, I used to
do C++ until about 10 years ago?

me too, we have similar backgrounds. I've got over a hundred legacy
Delphi programs and I'm slowly migrating to C#.

Eric
 
Back
Top