0

What I need to do seems simple enough but I can't seem to find a good way to do it. My app reads text off of a document but sometimes gets it wrong. Users are allowed to change the text in a verification step. What I need to know is how many characters changed, including case.

For example,
Original value: i23 MAin St
Value changed to: 123 Main Street
The number of characters changed in this instance would be 6. I then need to capture this value in a variable for later use. Is there a good way to do this in c#?

MtheBass
  • 21
  • 6
  • 1
    What if the user inserts and deletes characters? – SLaks Aug 22 '17 at 17:45
  • 5
    You're looking for Levenshtein Distance. – SLaks Aug 22 '17 at 17:45
  • 2
    https://www.dotnetperls.com/levenshtein – Koby Douek Aug 22 '17 at 17:47
  • _What I need to do seems simple enough_ No it isn't! At least if you allow deleting and inserting characters it is a really tough task with no exact solution! For a solution for doing a _diff_ see [here](https://stackoverflow.com/questions/24887238/how-to-compare-two-rich-text-box-contents-and-highlight-the-characters-that-are/24970638?s=1|0.2754#24970638) – TaW Aug 22 '17 at 18:17

0 Answers0