How do I get the differences between two string arrays in C#?

.net, arrays, c#, linq

Solution

I think this the shortest way to solve this

foreach (string com in com2 )
{
    if (!com1.Contains(com))
    {
        MessageBox.Show(com);
    }
}

Problem

How to compare two array string using C#.net? Eg: ``` string[] com1 = { "COM6", "COM7" }; string[] com2 = { "COM6", "COM7","COM8" }; ``` Here com1 and com2 are Array string. Result: COM8. How to achieve this?

Original source