find string in list string c# code example Example: list contains type c# if (within.OfType<Ball>().Any())