I'm having a list of string
List<String> MyList=new List<String>{ "A,B" , "C,D,E" , "F,G" };
I need to convert the List "MyList" into the following format
"A-B"
"B-A"
"C-D"
"C-E"
"D-C"
"D-E"
"E-C"
"E-D"
"F-G"
"G-F"
Now i'm using something like spliting each item by "," and then adding that to a new list, then taking combination and then performing union operation among all the lists.
Is there any way to do this using LINQ?