Hi there, I have two lists of strings. One of which contains validated terms (product types), the other which contains product names.
I would like to compare these two lists to find whether the product names contain any of the validated terms - these would be partial matches within the longer product names.
Sample product names:
Amazing Industries, furry dog coat
Amazing Industries shiny collar - M
Tasty Pet Food
Validated Product Types
Amazing Industries, furry dog coat, Product Type = Dog Coat
Amazing Industries shiny collar - M, Product Type =Collar
Tasty Pet Food, Product Type = Pet Food
Once it has found a match I then want to assign that product type to a variable that I can then add to a spreadsheet, but my current concern is how to find the partial match in an efficient way. Ideally avoiding loops if possible.
The nearest thing I’ve found is this thread using LINQ, but the data involved is fixed in length so they are able to pattern match using substrings.
My data is highly variable, so I need something more like a partial match - string.contains etc.
Any thoughts greatly appreciated.