Q:

How to check if string is in a list inside a list

I'm trying to validate IF a string exists inside a List<string>.  But the List<string> is inside List<List<string>>..
Kindly check my code below.  It throws an ArgumentException. 
loadTestList = new List<List<string>>();

loadTestList. ElementAt(loadTestSelect. SelectedIndex - 1).Contains(scorecardName);

Take note loadTestSelect is a dropdown/select that the user chooses from.  The user chooses the List<string> that would be validated. 
scoreCardName is the string that I want to search. 
Thank you very much! 

A:

try this:
if(loadTestList. Any(x => x.Contains(scorecardName))
{
   // Proceed specified item is present in one sublist
}

Or the following if you want to check for contains only in a specified sublist based on the selected index from the loadTestSelect
if(loadTestList[loadTestSelect. SelectedIndex].Contains(scorecardName))
{
   // Proceed specified item is present 
}

