As the title says my list \"Cvqt\" contains different strings for example \"1 maxHearts Player\"
and I\'m trying to check if it contains \" maxHearths \" + na
Your list contains strings in the form of maxClubs + " maxClubs " + name
while you're searching for " maxClubs " + name
. There will be no element in your list that exactly matches this (unless maxClubs
is an empty string).
You can use Linq Any for what you want:
if (Cvqt.Any(x => x.Contains(" maxClubs " + name)))
{
}