I'm trying to write a method that takes a List that contains two elements and checks that those elements are the same. I'm trying to set string variables equal to the indexed positions of the elements in the list and then use an if statement to determine if those elements are equal.
The problem I am having is that when attempting to call the list at all I get a "method name expected error".
Relevant code below:
static void CompareJson(List<string> jList)
{
string j = jList(0);
string k = jList(1);
if (j == k)
{
Console.WriteLine("");
}
else
{
Console.WriteLine("");
}
}
It's entirely possible that I'm going about this the wrong way, if so is there a better way to accomplish this?