Removing array items with word match?

Hey,

I have an array (of strings) which I’ve created from a scraped data table.

Within this array, I have a couple of entries I want to remove, however, these all depend on key words within each item.

I have a second array which contains key words as to what should be removed. How do I remove the entries from array 1 if matching key words in array 2?

Example:

Array1 is:

Upholstery - Smooth Finish Leather - Black
Adaptive Air Suspension including Porsche Active Suspension Management - PASM
ParkAssist Including Surround View

Array2 is:
Upholstery

Result:

Adaptive Air Suspension including Porsche Active Suspension Management - PASM
ParkAssist Including Surround View

Thanks for your help.

Hi @dr1992 ,

Could you Check with the below Expression :

Array1 = Array1.Where(Function(x)Not(Array2.Any(Function(y)x.Contains(y)))).ToArray
1 Like

Superman saves the day again :wink:

1 Like

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