Sahil Dev

Sahil Dev

  • NA
  • 77
  • 7.3k

IS there a better way to code this?

Apr 13 2016 3:57 AM
Hi,
 
I'm coding in C# and  have a code snippet as follows;
 
 
 If load.DescriptorName.Contains("tempLoad") Or 
load.DescriptorName.Contains("tempThruThickness") Or
load.DescriptorName.Contains("NodeIDTableTempLoad") Or
load.DescriptorName.Contains("tempThruThicknessTopBottom")
 {

//do something

}
 
 
My question is:
 
Rather than having so many 'Or', is there a better way to code this?
 
Sahil

Answers (1)