Possible to iterate backwards through a foreach?

前端 未结 11 2170
无人及你
无人及你 2020-11-27 03:54

I know I could use a for statement and achieve the same effect, but can I loop backwards through a foreach loop in C#?

11条回答
  •  春和景丽
    2020-11-27 04:31

    No. ForEach just iterates through collection for each item and order depends whether it uses IEnumerable or GetEnumerator().

提交回复
热议问题