Boolean Expression in .NET: strName IN ('CHRIS','TOM','TYLER')

I think it would be really helpful if we could do boolean expressions with IN sort of like we can in SQL.

For Example:

'just like SQL
If strName IN ("CHRIS","TOM","TYLER") Then
  'do something
End If

'using an array for this would be best
Dim arrNames() AS String = New Array{"CHRIS", "TOM", "TYLER"}
If strName IN arrNames Then
  'do something
End If

'or like this
If strName IN New Array{"CHRIS", "TOM", "TYLER"} Then
  'do something
End If

p.s. You’ll have to excuse any bad code grammar, I typed this straight from my head

Chris Pietschmann
Chris Pietschmann
Cloud Infra & Security | Microsoft MVP | HashiCorp Ambassador | MCT | Developer | Author

I am a solution architect, SRE, developer, trainer and author. With 25 years of experience in the Software Development industry that includes working as a Consultant and Trainer in a wide array of different industries.