• 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: Deleting the last word of an NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting the last word of an NSString


  • Subject: Re: Deleting the last word of an NSString
  • From: Jonathan del Strother <email@hidden>
  • Date: Sat, 6 Aug 2005 02:00:31 +0100

Ahh - handy, thanks.
One question - why is that method in NSAttributedString rather than NSString? Surely NSAttributedStrings are more about the display and presentation of a string, whereas nextWordFromIndex sounds like something common to both classes...


Jon


On 6 Aug 2005, at 01:44, Aki Inoue wrote:

-[NSAttributedString nextWordFromIndex:forward:] is what the Text System uses.

Aki


I need to delete the last word in an NSString. In theory, this is easy, but I need to replicate the behaviour of a Cocoa text field when you press Option-Backspace. I keep on running into special cases where my solution doesn't quite match up, and was wondering if there was a definitive way of finding what the last word is, complete with Cocoa's considerations for punctuation.

Thanks,
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden





_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Deleting the last word of an NSString
      • From: Aki Inoue <email@hidden>
References: 
 >Deleting the last word of an NSString (From: Jonathan del Strother <email@hidden>)
 >Re: Deleting the last word of an NSString (From: Aki Inoue <email@hidden>)

  • Prev by Date: Memory management problem - solvee
  • Next by Date: Adding Spotlight keywords to files
  • Previous by thread: Re: Deleting the last word of an NSString
  • Next by thread: Re: Deleting the last word of an NSString
  • Index(es):
    • Date
    • Thread