["..E$ ","A&Be.B+B~EC|FG574G574G5746}sBCX","Any."," This method receives a Predicate. It determines if a matching element exists in a collection. We could do this with a loop construct. But the Any extension method provides another way. It reduces code size. ","Extension ","extension","Example."," Please include the System.Linq using directive at the top of your program. This allows you to call the Any extension. In this example, we see an array of 3 integer values. These values determine the results of the Any method. ","Int Array ","int-array","Methods: ","The first call tests for any even int. The second tests for any int greater than 3. The third checks for any int equal to 2.","Odd, Even ","odd","You can, when executing the program on your computer, change the expressions in the lambda to determine the correctness of the tests."," .NET 4.7 (2017)\n\n","C# program that uses Any extension method","\n\nusing System;\nusing System.Linq;\n\nclass Program\n{\n static void Main()\n {\n int[] array = { 1, 2, 3 };","\n // See if any elements are divisible by two.\n ","bool"," b1 = array.","Any","(item ","=>"," item % 2 == 0);","\n // See if any elements are greater than three.\n ","bool"," b2 = array.","Any","(item ","=>"," item > 3);","\n // See if any elements are 2.\n ","bool"," b3 = array.","Any","(item ","=>"," item == 2);","\n // Write results.\n ","Console.WriteLine(b1);\n Console.WriteLine(b2);\n Console.WriteLine(b3);\n }\n}\n\n","\n\nTrue\nFalse\nTrue","Internals."," How does the Any method actually work? When you call the Any method, you are passing a Predicate type, which is a function with a bool result. Internally, the Any method loops through each element in the source collection. ","Predicate ","predicate","Then: ","When it finds an element that the Predicate returns true for, the true result is propagated. It uses an early-exit.","Summary."," The Any method evaluates a Predicate method on the source collection and returns a boolean indicating whether any element matches the Predicate. This method elegantly replaces imperative loop constructs."]

%iVBORw0KG;)NSUhEUg?ALM?ABSCAM)o0hXm)GFBMVEX::3z8PzZ4v3sbf0k5r68N/xH2v157ja+sAc?ACl0lEQVR4Xu2awYqEMBAFp5Po/P8fLzPsQS2kNisNNtjXwFLte1NxwddxlnU/8f7M69bTD8zjy7zcmnkcmFsB5vU479uXI8DcUY4b1rlcodumEJtC37ocW85Wo9Cx7UOvUeixvUiiRqH3dShR6GWvilHh+j40uFcoxziYosD1jQIXsB1EUcB2QLxku+jjm1Nro8d7WZZ807EsM6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