• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: return string that is the difference between two other strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return string that is the difference between two other strings


  • Subject: Re: return string that is the difference between two other strings
  • From: Scott Ribe <email@hidden>
  • Date: Sat, 20 Sep 2014 11:43:22 -0600

On Sep 20, 2014, at 11:13 AM, 2551 <email@hidden> wrote:

> For example:
>
>   NSString *mary = @"mary had a little lamb, a little lamb she had";
>    NSString *scary = @"mary had a little lamb, a little naughty fella of a lamb she had for sure";
>    NSString *isDifferent = [self getDifference:mary and: scary];
>    NSLog(@"%@", isDifferent);
>
> The method I posted below produces the difference that I want ("naughty fella of a for sure"). But I want to know if there's a more orthodox and robust solution.

That's not even remotely close to a definition of what you mean. What about:

@"mary had a little lamb, a little naughty lamb she had"

vs

@"mary had a little lamb, a little fella of a lamb she had for sure"

?

Or:

@"mary had a little lamb, a naughty little lamb she had"

vs

@"mary had a big lamb, a little fella of a lamb she had for sure"

There is no simple definition of "the difference between two strings", and I don't think it's a basic need at all.

--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: return string that is the difference between two other strings
      • From: Diederik Meijer | Ten Horses <email@hidden>
    • Re: return string that is the difference between two other strings
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: return string that is the difference between two other strings
  • Next by Date: Re: return string that is the difference between two other strings
  • Previous by thread: Re: return string that is the difference between two other strings
  • Next by thread: Re: return string that is the difference between two other strings
  • Index(es):
    • Date
    • Thread