How do i find out if a string is containing the exact word i am looking for?
example: “this is my text”; word looking for: “text”; found: yes.
example: “these are my texts”; word looking for: “text”; found: no.
- it’s inside a linq to entities query, so regex won’t work?
Edit:
This is more or less what i’m doing now and i want to replace it by a function that returns only when it’s the exact match.
using (Model.Manager ctx = new Model.Manager())
{
var result = from p in ctx.Companies where p.Name.Contains(workLookingFor) select p;
}
Solution so far:
I could use .Contains() on my DB and use RegEx on the results pulled from the DB. Since the exact matches are always inside the broader results from .Contains() (which i still need anyways) this could be a good solution
There isn’t an easy way. You have three options