Skip to content

Instantly share code, notes, and snippets.

@alvpickmans
Created February 22, 2019 17:10
Show Gist options
  • Save alvpickmans/f7cde898970c7c859d41a55a93ca8303 to your computer and use it in GitHub Desktop.
Save alvpickmans/f7cde898970c7c859d41a55a93ca8303 to your computer and use it in GitHub Desktop.
Getting the next index of index in an array, looping to 0 if is last index
for(var i = 0; i < MyArray.Count(); i++)
{
int nextIndex = (i + 1) % MyArray.Count();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment