What does “yield break;” do in C#?

后端 未结 8 1958
南方客
南方客 2020-11-28 01:04

I have seen this syntax in MSDN: yield break, but I don\'t know what it does. Does anyone know?

8条回答
  •  情歌与酒
    2020-11-28 01:20

    Ends an iterator block (e.g. says there are no more elements in the IEnumerable).

提交回复
热议问题