Answer the question
In order to leave comments, you need to log in
How to do an array search?
Hello!
I’m stupid, but I can’t figure out whether it is possible to solve the following problem without explicit cycles:
There is an array of roots for male names / patronymics: Gennad, Il, Vladislav, Grigor, etc.
How to check if the word "Gennady" has a match from this array?
Answer the question
In order to leave comments, you need to log in
string test = "Геннадий";
bool result = Roots.Any(x=> test.Contains(x));
No cycles? Even without the implicit ones (Contains contains a loop)? IMHO no.
Without cycles - it means library means?
stackoverflow.com/a/10366607
Algorithms: Aho-Korasik, KMP.
I think the cycle means the passage through all the elements.
And if you split the data so that you don’t have to do this (tree), then the answer is yes.
Like - the first letter 'G' - yes / no, this already removes 32 letters and everything below them, i.e. no longer a cycle.
And Many .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question