Restriction Operators : Restriction : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Restriction »

 

Restriction Operators








    
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass {
    public static void Main() {
        int[] numbers = { 5, 4, 1, 3, 9};

        var lowNums =
            from n in numbers
            where n < 5
            select n;

        Console.WriteLine("Numbers < 5:");
        foreach (var x in lowNums) {
            Console.WriteLine(x);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Restriction