C
Join ServerC#
help
Ez LINQ Noob Question
NNatty12/15/2022
How can I make this return a true/false? Is there a way to clean this up without adding a
.Count() > 0
call?bool onlyContainsQuarters = allDates.Where(x => quarterEndMonths.Any(prefix => x.StartsWith(prefix)));
NNatty12/15/2022
quarterEndMonths
is a hashset of prefixes.RARD Asher12/15/2022
Would this not work?:
bool onlyContainsQuarters = allDates.Any(x => quarterEndMonths.Any(prefix => x.StartsWith(prefix)));
TTheRanger12/15/2022
replace Where with Any i think
NNatty12/15/2022
yea thats what i was actually just typing up lol
NNatty12/15/2022
thanks guys
TTheRanger12/15/2022
ah someone beat me
NNatty12/15/2022
just caught it too 😛 these LINQ still sometimes get me for sure
NNatty12/15/2022
appreciate it all