I find it a lot more complicated than I thought. How to move a section of items in a list?
For example, if I have the following list:
List<int> myList = new List<int>(); for(int i=0; i<10; i++) { myList.Add(i); }
This list will contain { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } .
How can I move sections of a list? Let's say I want to move { 7, 8, 9 } to the 4th index by doing this:
{ 0, 1, 2, 3, 7, 8, 9, 4, 5, 6 }
Or, say, I want to move { 1, 2 } to { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } by the 8th index by doing it:
{ 0, 3, 4, 5, 6, 7, 1, 2, 8, 9 }
Can someone provide the code? Something that takes 3 meanings, such as the following, would be great.
MoveSection(insertionPoint, startIndex, endIndex)
Please note that when deleting partitions from the beginning, the insertion location has changed. This makes it rather complicated.