To Get List string data with IEnumerable using LINQ.

Posted by Jitendrasoft09 under C# category on | Points: 40 | Views : 705
using System;
using System.Collections.Generic;
using System.Linq;

class jkExample {

static void Main(string[] args) {

List<string> listobject = new List<string>() {
"apple", "Mango", "grape", "banana"};

IEnumerable<string> mydata = from e in listobject
select e;

foreach (string str in mydata) {
Console.WriteLine("Fruits are: {0}", str);


Comments or Responses

Login to post response