if or statment

  • Thread starter Thread starter David Hubball
  • Start date Start date
D

David Hubball

Hi

I know this topic will be really easy for most people in this group
but can someone help me to get this statement working please. Thanks

if (txtFirstPrize.Text==""|txtSecondPrize.Text=""|
txtThirdPrize.Text="") return;

I'm just tryng to get my program to return is any of these 3
properties are blanks.

Thanks
David
 
Hi

Sorry to waste anyones time.

I've worked out the answer - my command should of been :-
if (txtFirstPrize.Text == "" | txtSecondPrize.Text =="" |
txtThirdPrize.Text =="") return;

So everyone can ignore this topic

thanks
David.
 
jp2msft said:
Why exactly does FxCop recommend using string.IsNullOrEmpty? Is it more
efficient?
Yes, basically. See http://msdn.microsoft.com/library/ms182279

It's also slightly more obvious: it may not be intuitive that a test of the
form 's == ""' tests that the string is empty and not-null (and a test of
the form 's != ""' tests if it's non-empty *or* null).
 
Back
Top