Sort items in list to most similar to a specific string [Answered]
How can I sort items in a
List<string>
by similarity to a certain string?3 Replies
You have to start by defining similarity. I would do it as a method that returns a number based on how similar.
Then you can simply use OrderBy and pass the similarity method
Thanks, I’ll use string.Compare()
✅ This post has been marked as answered!