only keep every 10th entry in an array?

hey!
i have this huge list of arrays:

in my

public Vector3[]    paths;  

but i wanna kick out some of them. so that i keep Element 0 , 10 , 20 and so on.
how can i do this?

Iterate over your list with a for-loop. Use the modulus operator.

With “i” as your current index, “i % 10” will be 0 for each 10th item.

Maybe create a new paths array and in a for loop, copy every 10th element from the initial paths array. Something like:

Vector3[] newPaths = new Vector3[paths.Length/10];
	int j = 0;

	for (int i = 0; i < paths.Length; i+=10) {
		newpaths[j] = paths*;*
  •  j++;*
    
  • }*
    You can then clear paths and copy newPaths into it.