Linq SelectMany ListofDictionary

Hello!

I have a

List<Dictionary<string, string>>

the dictionary consists of mail details, example:
{
[“name”] = “Adam”,
[“mail”] = “abc@abc.com
[“subject”] = “test 123”
}
{
[“name”] = “Deo”,
[“mail”] = “abcd@abc.com
[“subject”] = “test email”
}

I would like to use LINQ to get all subject that contains number. I found some examples using datatable but not in list of dictionary.

Thanks!

Hi,

Can you try the following expression?

image

subjects = listDict.Select(Function(d) d("subject")).Where(Function(s) System.Text.RegularExpressions.Regex.IsMatch(s,"\d")).ToArray()

Main.xaml (6.8 KB)

Regards,

1 Like

This worked! Thanks a lot!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.