Boolean Expression in .NET: strName IN ('CHRIS','TOM','TYLER')
Jun 24, 2005 • Chris Pietschmann • .NET • Visual BasicI 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
DevOps & AI Architect | Microsoft MVP | HashiCorp Ambassador | MCT | Developer | Author
I am a DevOps & AI Architect, developer, trainer and author. I have nearly 25 years of experience in the Software Development industry that includes working as a Consultant and Trainer in a wide array of different industries.