I have an application can compare two lsts of data the user inputs. Currently however, if two values are the same but one is upper case the application classes this as not a match.
Now I have used StringComparison.InvariantCultureIgnoreCase
before but I am unsure of how to add this within a foreach loop.
My current code is as follows;
List<string> mylistA = new List<string>();
List<string> mylistB = new List<string>();
if (listATextBox.LineCount > 0)
for (int i = 1; i <= listATextBox.LineCount; i++)
mylistA.Add(listATextBox.GetLineText(i - 1).Replace(Environment.NewLine, "").Trim());
if (listBTextBox.LineCount > 0)
for (int i = 1; i <= listBTextBox.LineCount; i++)
mylistB.Add(listBTextBox.GetLineText(i - 1).Replace(Environment.NewLine, "").Trim());
foreach (string line in mylistA)
{
if (mylistB.Contains(line))
{
ResultsToDocument();
}
}