Repeatedly, I keep running into versions of the same basic problem while coding:
I have two strings that are similar, but not identical, and I need to be able to highlight the similarities and/or the differences.
Two basic examples:
1) Are there any standard algorithms for this problem domain? I've reinvented this wheel dozens of times over the years and am tired of re-thinking it every few months when it reoccurs in another program. I'd love to just implement something standard (or find an implementation of something) and just re-use it.
2) Are there any Visual Studio add-ins that do this type of thing in the debugger? I'd love a magic "visually compare two strings" tool while debugging.
I have two strings that are similar, but not identical, and I need to be able to highlight the similarities and/or the differences.
Two basic examples:
- I'm debugging a WPF Rich TextBox bug where the framework is occasionally inserting a random additional space into the content. When I detect that this has happened, I need to quickly highlight where the additional space is at.
- I'm importing user created files from users users who only loosely follow naming conventions. If I'm scanning a list of files for the one with Dr. Troshane's Address, I'd like to be able to auto-pick any candidate files with names like: Troshane_Address.xml, Troshane Address 1.xml or AddrTroshane.xml. (IOW, look to see if there is a file with a high probability of being the right one, and auto-pick it so the operator's workload of manually selecting which import file goes to what will be greatly reduced.)
1) Are there any standard algorithms for this problem domain? I've reinvented this wheel dozens of times over the years and am tired of re-thinking it every few months when it reoccurs in another program. I'd love to just implement something standard (or find an implementation of something) and just re-use it.
2) Are there any Visual Studio add-ins that do this type of thing in the debugger? I'd love a magic "visually compare two strings" tool while debugging.