I have a dictionary of array of string.
Example:
Arr = {“#123 ABCDE XXX, “#567 Apple YYY”, “#889 Orange ZZZ”}
I need to check if the array contains a certain keyword(like as Apple).
And get the item in array.
Thanks!
I have a dictionary of array of string.
Example:
Arr = {“#123 ABCDE XXX, “#567 Apple YYY”, “#889 Orange ZZZ”}
I need to check if the array contains a certain keyword(like as Apple).
And get the item in array.
Thanks!
Arr = New Dictionary(Of String, String) From {
{"item1", "#123 ABCDE XXX"},
{"item2", "#567 Apple YYY"},
{"item3", "#889 Orange ZZZ"}
}
matchedItems = Arr.Where(Function(kvp) kvp.Value.Contains("Apple")).Select(Function(kvp) kvp.Value).ToList()
That works! Thank you!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.