c# check if part of text appears in list code example Example: list contains type c# if (within.OfType<Ball>().Any())