Newbie operator question

  • Thread starter Thread starter Anders Jansson
  • Start date Start date
A

Anders Jansson

Hi,
Trying to use and "AND" operator comparing strings in C#. The following code
doesnt work (mtch1_ etc is of type String):

if (mtch1_ = "" & mtch2_ = "" & mtch3_ = "" & mtch4_ = "")



What should I use instead?

Best Regards

Anders
 
Try and change that to:

if (mtch1_ == "" && mtch2_ == "" && mtch3_ == "" && mtch4_ == "")

/Joakim
 
Just to explain the fix.
single equals (=) is assignment (returns value on the right hand side)
double equals (==) is comparison (returns boolean signifying equality)

Ciaran
 
Back
Top