This algorithm is about to store strings from Array A to Array B by storing “A”, “B” to Index 8 and Index 9
I really initiate to make the array size of B to be 10 because later I will put some other things there.
My partial code:
string[] A = new string[]{"A","B"}
string[] B = new string[10];
int count;
for(count = 0; count < A.length; count++)
{
B[count] = A[count]
}
So you want to increment every index with 2:
Demo
Edit: So you want to start with index 0 in B and always leave a gap?
Demo
Update ” Is there any alternative coding aside from this?”
You can use Linq, although it would be less readable and efficient than a simple loop:
Final Update according to your last comment(start with index 1 in B):
Demo