Mega Code Archive

 
Categories / C# / LINQ
 

Prints strings where each element has the second letter i

using System; using System.Collections.Generic; using System.Linq; using System.Text; public class MainClass {     public static void Main() {         string[] digits = { "ziro", "one", "two", "three"};         var reversedIDigits = (             from d in digits             where d[1] == 'i'             select d)             .Reverse();         foreach (var d in reversedIDigits) {             Console.WriteLine(d);         }     } }