How do you test multiple values for equality in one line? Basically I want to do
if (val1 == val2 == val3 == ... valN)
but in VB.Net.
If val1 = valN AndAlso val2 = valN AndAlso ... Then
End If
This can get cumbersome when testing more than a few values.
There is no way to chain them together like that. You need to break it up into pair'd comparisions linked by AndAlso
if val1 = val2 AndAlso val2 = val3 AndAlso val1 = val3 Then
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With