yield return : IEnumerable : Class Interface C# Source Code


Custom Search

C# Source Code » Class Interface » IEnumerable »

 

yield return








    
 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

class Program {
    public static IEnumerable<string> SimpleList() {
        yield return "1";
        yield return "2";
        yield return "3";
    }

    public static void Main(string[] args) {
        foreach (String item in SimpleList())
            Console.WriteLine(item);

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Class Interface
» IEnumerable