I have this very simple array which I want to be able to move around some items in. Are there any built in tools in c# to do this? If not, du you have any suggestion in how
This solved my problem
var arr = new ArrayList
{
"a", "b", "c", "d", "e", "f"
};
var first = arr[2]; //pass the value which you want move from
var next = arr[5]; //pass the location where you want to place
var m = 0;
var k = arr.IndexOf(first, 0, arr.Count);
m = arr.IndexOf(next, 0, arr.Count);
if (k > m)
{
arr.Insert(m, first);
arr.RemoveAt(k + 1);
}
else
{
arr.Insert(k, next);
arr.RemoveAt(m + 1);
}
returns a, b, f, c, d, e