C
C#2y ago
aj

❔ What's the easiest way to see if a list contains a certain string?

What's the easiest way to see if a list contains a certain string?
5 Replies
Pobiega
Pobiega2y ago
.Contains, assuming the list is a list of strings
aj
ajOP2y ago
would i have to put it through a for loop? or would .Contains by itself work
Pobiega
Pobiega2y ago
List<T> has a Contains(T) method that returns a bool You don't need to loop
aj
ajOP2y ago
ohhh i see, thanks a lot!
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server