Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8570135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:29:27+00:00 2026-06-11T18:29:27+00:00

So this is what I have for my list. [0], [1], [2], [3], [4]

  • 0

So this is what I have for my list.

[0], [1], [2], [3], [4]

I want to be able to loop through these – But the trick here is that I want to start at an offset then loop around back to that offset?

ex.

[0], [1], [2], [3], [4]
      o-->            
//Start at offset 1 then get 2, 3, 4 then loop back around to zero

ex2.

[0], [1], [2], [3], [4]
                o-->            
//Start at offset 3 then get 4, then loop back around to zero, then 1, 2 

I thought about using the regular List<T> and trying to implement this concept into a for loop but I’m not sure if I want to do that if theirs a more concise way of doing so.

Basically don’t start at 0 and loop back to the start and go through the elements back to the offset.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:29:28+00:00Added an answer on June 11, 2026 at 6:29 pm

    You are really describing a ring buffer or circular buffer.

    http://en.wikipedia.org/wiki/Circular_buffer

    The simple implementation is

    int start; // Set your desired start offset
    
    for (int i = start; i < myList.Length; i++)
    {
        // do stuff
    }
    
    for (int j = 0; j < start; j++)
    {
        // do stuff
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a full list that populates a UITableView . This I want to
I have code that I want to look like this: List<Type> Os; ... foreach
I have a List<T> that I want to be able to copy to an
I have an array of images that I want to loop through infinitely ie.
We Have this : List<Person> listPerson ; Want to use the Data of listPerson
I have List of particular class. I want to save this List at a
I have this situation where I want to display a list of Administration objects
I have a list areas :: [Double]. Now I want to filter this list
I have this class: class OriginalClass { string FirstItem; List<string> ListOfSecondItems; } I want
If I have a list of numbers like this one: 10,9,8,8,9,7,6,5,4,6,7,8,11,10,12,14,16,20,30,29,28,29,27,25,20,18,15,10,8,5,4,1 I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.