Help With a comparision

here is what is going on, I will post code at end. I need to take the name of the item the script is on split it take the first part and compare it to a string that is in a list the. chestName is the name of the item, keys is holding the list from another script, the last line is my last attempt that finally drove me over the edge and sent me here to search for some help. what will happen in the end is if I have the matching key in my list it will unlock a chest of matching color both items have the same start (Gold_Key and Gold_Chest)

	void CheckKey(){
		string[] chest = chestName.Split (new char[]{'_'});
		List<string> keys = playerStats.keyList;
		string thisKey = keys.Find (keys == chest [0]);

	}

You probably just want to use the function IndexOf, it gets the index of the string in the list, and if not it returns the number -1:

string[] chest = chestName.Split (new char[]{'_'});
List<string> keys = playerStats.keyList;
int keyIndex = keys.IndexOf(chest [0]);

if(keyIndex >= 0)
{
    //Key is in inventory
}
else
{
    //No Key
}

If you don’t really need to know the index (or don’t care where in the list the key is) you can just use the function Contains instead:

bool hasKey = keys.Contains(chest[0]);