Take these two lists:
List 1
Red green blue
List 2
Brown Red Blue Purple Orange
I am looking for a way to combine these lists together to create:
List 3
Brown Red Green Blue Purple Orange
I think the basic rules are as follows:
1) Insert at the top the list of any line falling before the first common line (for example, Brown comes before the first common line, Red);
2) Insert items between the lines if both lists have two items (for example, in list 1, a green color is inserted between red and blue); and
3) Insert the lines at the bottom if there is no โgapโ between them (for example, in list 2, the orange is inserted at the bottom).
Lists are stored in a DataTable. I assume that I will have to switch between them during the iteration, but it is difficult for me to define a method for combining strings.
Thanks for any help.
- Brent
source share