How to create ienumerable of strings in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

class Program
{
    static void Main() {
        IEnumerable<string> iEnum = new List<string>() { "c#", "c", "c++"};

        foreach (string s in iEnum) {
            Console.WriteLine(s);
        }
    }
}




/*
run:

c#
c
c++

*/

 



answered Aug 2, 2023 by avibootz
...