zl程序教程

您现在的位置是:首页 >  后端

当前栏目

What is the use of c# “Yield” keyword ?

c# The of is use What keyword yield
2023-09-11 14:14:18 时间

What is the use of c# “Yield” keyword ?

“Yield keyword helps us to do custom stateful iteration over .NET collections.”

 
There are two scenarios where “yield” keyword is useful:-
  • Customized iteration through a collection without creating a temporary collection.
  • Stateful iteration.