C# WinApp: Let's say I search for dtg but the items that I am searching in are dvg , dz, dxg ... so I want it to find dvg for me because it is closer to dtg that I was searching for. I know there are some NP-hard algorithms for that but really I do not want to spend a ton of time on this. is there any String methods that does something close to this? or can do it with a few extra liens of code?
You'd need a metric describing the difference between two strings. A common approach is to use the Levenshtein distance, which is quickly implemented using a few lines of C# code (code files are available online).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With