Answer the question
In order to leave comments, you need to log in
Is there a similar solution in c#?
Python has this operation:
if smth in smthList:
pass
Answer the question
In order to leave comments, you need to log in
Well, the List class has a Contains method, for example. Quite analogous.
if (smthList.Contains(smth))
DoBusiness();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question