using System.Collections.Generic;
public static void Main()
var names = new List<string> {"safar","yatri","pavan","you"};
List<string> names2 = new List<string> {"safar","yatri","pavan","you"};
Console.WriteLine("List of names are ");
Console.WriteLine("===================");
foreach(var name in names)
Console.WriteLine("List of names are ");
Console.WriteLine("===================");
for(int i=0;i<names.Count;i++)
Console.WriteLine(names[i]);
var found = names.IndexOf("safar");
Console.WriteLine("found safar at "+ found+" position ");
var found2 = names.IndexOf("Bhavin");
Console.WriteLine("OOps looks like there is no name like :"+found2);
Console.WriteLine("found name at "+ found2+" position ");
Console.WriteLine("After the sorting the list is");
foreach(var name in names)