> On Sep 20, 2014, at 10:43 AM, Scott Ribe <scott_r...@elevated-dev.com> wrote:
> 
> There is no simple definition of "the difference between two strings", and I 
> don't think it's a basic need at all.

Usually when programmers talk about "differences" they're referring to 
something like what a 'diff' tool produces, which is basically a description 
showing the insertions/deletions that have to be made to the first string to 
produce the second. This is a very useful type of algorithm that's used a lot 
in version-control systems, especially because you can later apply the diff 
output to the first string and reconstruct the second.

Diff algorithms are fairly complex, though, and the details depend a lot on 
what the granularity of the insertions/deletions is — the usual diff tools 
consider lines of text as units, but there are "binary delta" algorithms whose 
units are individual bytes and that will operate on arbitrary data.

I'm still not clear what exactly the OP is asking for. It looks like maybe just 
a set of the words that are in the second string but not in the first? Keary's 
solution works well for that.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to