I got this List :
private static List<Type> _AbstractTypes = new List<Type>();
and later in my project I got a string that corresponds to a Type.FullName.
The thing is that I’d like to check if my string is contained in my List but I don’t manage to avoid a loop usable 🙁
Im looking for something like :
_AbstractTypes.FullName.Contains(myString)
I am absolutely aware that my previous code is not compilable at all but that’s the sort of thing im looking for !
Thanks in advance for any help
You can use Linq, but we are talking about loop-less construct here only, the code under the hood must do a loop, if you want to do it better, you could use
HashSet<T>.Linq code could look like this:
HashSet<Type>code could look like this: