Hi folks,

If I have a String[] set up like the following:

Code:
int x = 10; //The number of elements in the array

String[] myArray = new String[x];

for(int i = 0; i < myArray.Length; i++)
{

myArray[i] = (i.ToString());

}
And then I want to repeatedly shift the elements of the array one position each time the method below is called, is the following code I've written the most efficient?

Code:
privare void rotateArrayValues()
{

//This example rotates the values in the array 1 position 
//anti-clockwise each time it is called

//Store the 1st element of the array
String temporaryStorageA = myArray[0];

String[] temporaryStorageB = new String[myArray.Length];

for(int i = 1; i < myArray.Length; i++)
{

temporaryStorageB[i-1] = myArray[i];

}

temporaryStorageB[myArray.Length-1] = temporaryStorageA;

for(int i = 0; i < myArray.Length; i++)
{

myArray[i] = temporaryStorageB[i];

}

}

//Do something else, etc, etc.
Has anyone got a better, more efficient way of doing the above? Thanks