You have to analyze what you can lose. The search or index access in the structure shown by lbotinelly / Ono Sendai (whatever name he is using now: P) is bad (not that his response is bad). If that's not important, go to it.
If access is important, you have to find another structure. You may have to completely rethink what you are using. The mistake may be somewhere else. Without context it's hard to say.
One thing you can do if you can change the structure is to use an array . Then you can use ArraySegment
. You can "create" a segment where the first element is not present, you do not erase the data, but you get a structure where that element is no longer accessed and the indexes are obviously repositioned. So if you take a segment starting at element 1, this element will change to 0 in the new variable. Access continues easy and fast as it is in Array
or List
, does not copy anything and gets what you want.
Other solutions may be possible if certain conditions can be met.
var novoArray = new ArraySegment<Cliente>(meuArray, 1, meuArray.Length - 1);