Following might help you,
using System;
using System.Linq;
namespace ConsoleApplication1
{
class MyClass
{
static void Main(string[] args)
{
string separator =",";
Console.WriteLine(Intersect("a,b,c,d,e", "b,e", separator));
}
private static string Intersect(string item1, string item2, string separator)
{
return string.Join(separator, item1.Where(item => !item2.Contains(item)));
}
}
}
The above program will produce the following output,
a,c,d
Press any key to continue . . .
Please see below for further Ref:
Hope it helps :)