// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Linq; namespace E { public class Program { public static string StringListDiff(string s1, string s2) { return string.Join(", ", s1.Split(", ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Except(s2.Split(", ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries), StringComparer.InvariantCultureIgnoreCase).ToArray()); } public static void Main(string[] args) { string s1 = "john, Tom, Linda, frank, foo, Bar"; string s2 = "Tom, John, Frank, bar"; string s3 = StringListDiff(s1, s2); Console.WriteLine(s3); } } }