C# has the keyword called yield. VB.NET lacks this keyword. How have the Visual Basic programmers gotten around the lack of this keyword? Do they implement they own iterator class? Or do they try and code to avoid the need of an iterator?
The yield keyword does force the compiler to do some coding behind the scenes. The implementation of iterators in C# and its consequences (part 1) has a good example of that.
VB.NET has the
Iterator
keyword https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/modifiers/iteratorSince Visual Studio 2012 it seems
The below code gives the output
2, 4, 8, 16, 32
In VB.NET,
In C#