forum

home / developersection / forums / check if a variable is in an ad-hoc list of values

Check if a variable is in an ad-hoc list of values

Anonymous User 2172 06-Jun-2013
Hi Expert,

Is there a shorter way of writing something like this:

if(x==1 || x==2 || x==3) // do something

What I'm looking for is something like this:

if(x.in((1,2,3)) // do something

Please help.
Thanks in advance.

c# c# 
Updated on 06-Jun-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By