Need to Filter Emails with specific subject with multiple values

Hi
I want to filter the subject line contain below values and it should have only one of below values not more than that

DCD,ECD,KCD,LCD,RCD,SCD

if the subject line contains only one of these values i want to perform further actions with these emails only

Hi,

how about the following?

mails = mails.Where(Function(m) keywords.Where(Function(s) m.Subject.Contains(s)).Count=1).ToList

Regards,

@Yoichi
Thanks a ton for your prompt response:-)
let me try this and will get update here asap

Worked as per requirement thanks a lot :grinning: :grinning:

Hi @ashokkumar_e,

As the solution from @Yoichi, worked please mark it as solution for closing the thread !!

Thanks

solution worked kindly close the thread