How to find difference between two strings?
Asked Answered
F

1

26

I have two strings and would like to display the difference between them. For example, if I have the strings "I am from Mars" and "I am from Venus", the output could be "I am from Venus". (Typically used to show what changed in an audit log, etc.)

Is there a simple algorithm for this? I am using C# but I guess a generic algorithm could be adapted from any programming language.

Or is there a framework class/third-party library that will do this sort of thing?

Frequentation answered 16/10, 2008 at 10:53 Comment(1)
string.Replace: #7518071Orthogenesis

© 2022 - 2024 — McMap. All rights reserved.