I have an array and I want to shift its element to left without any helper array... how can I do this? I tried to do this but I think it's not the best way... a1 is an array that I want to shift its element
for (int i = 0; i < a1.Length ; i++)
{
foreach (var element in a1)
{
current = element;
next = a1[i];
next = current;
}
current = a1[i];
next = a1[i + 1];
a1[i] = next;
}