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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top