Query LINQ operator%

1

What does% 2 mean?

 string[] names = {"Geraldine", "Julieth", "Tatiana", "Maribel", "Susana", "Mónica"};
var Query = from x in names
        where (x.Length) > 5 && (((x.Length)%2)!=0)
        select x;
Query.Dump();
    
asked by Pedro Ávila 06.06.2016 в 01:44
source

1 answer

3

In this case, % is the operator module . For the code you submit, the condition

(((x.Length)%2)!=0)

It means that the length of x must be odd.

    
answered by 06.06.2016 / 03:51
source