How can i compare two strings in c# and gets the difference?
for example:
String1 : i have a car
string2 : i have a new car bmw
result: new
You can use a difference algorithm for this task. The paper "An O(ND) Difference Algorithm and Its Variations" describes a quite powerful algorithm to accomplish this task. For an implementation in C#, you can have a look at "An O(ND) Difference Algorithm for C#", but IMHO it surely is more interesting to have a look at the paper and implement it for yourself in case you're interested on how the algorithm works in detail.