Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Articulos.Cap04
- {
- public sealed class ExpLambdaLinq
- {
- public static void Main()
- {
- // 1. Fuente de datos:
- string[] blog = { "OrtizOL", null, "Experiencias", null, null, "Construcción", "Software", "xCSw", null };
- // 2. Diseño de la consulta:
- var consulta1 = blog.Where(cadena => cadena != null);
- // 3. Ejecución de la consulta:
- foreach (string cadena in consulta1)
- {
- Console.WriteLine (cadena);
- }
- Console.WriteLine ();
- var consulta2 = blog.Where (cadena => !string.IsNullOrEmpty(cadena));
- foreach (string cadena in consulta2)
- {
- Console.WriteLine (cadena);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement