Any operator with an string array : Any « LINQ « C# / C Sharp






Any operator with an string array

 

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

public class MainClass {
    public static void Main() {
        string[] presidents = {"G", "H", "a", "H", "over", "Jack"};

        bool any = presidents.Any();
        Console.WriteLine(any);
    }
}

 








Related examples in the same category

1.Any with condition
2.Use Quantifiers: Any
3.Any with string operator
4.Any with false predicate
5.Contains, Any return a bool value