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
Microsoft MVP | App Innovation Leader | Azure, AI & DevOps Architect | HashiCorp Ambassador | Author
I'm a Practice Leader, App Innovation specialist, solution architect, developer, SRE, trainer, and author with 25+ years of experience helping enterprises turn AI, app modernization, cloud architecture, and DevOps into real business outcomes.