checking for a string in a list of objects code example Example: list contains type c# if (within.OfType<Ball>().Any())