var commonNames = firstList .Select(m => m.Split('(')[0].Trim()) .Intersect(secondList);
与Austin Salonen指出的TextBoxes一样
var firstList = textBox1.Text.Select(m => m.Split(Environment.NewLine)); var secondList = textBox2.Text.Select(m => m.Split(Environment.NewLine)); resultTextBox.Text = string.Join(Environment.NewLine, firstList .Select(m => m.Split('(')[0].Trim()) .Intersect(secondList));