I got a List<string>
named Test
:
List<string> Test = new List<string>();
I want to add a string to it using Test.Add();
, but first I want to check if it already exists in the list.
I thought of something like this:
if (Test.Find("Teststring") != true)
{
Test.Add("Teststring");
}
However, this returns an error.