• 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: replaceFirstOccurenceOf?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replaceFirstOccurenceOf?


  • Subject: Re: replaceFirstOccurenceOf?
  • From: Gus Mueller <email@hidden>
  • Date: Fri, 1 Aug 2003 08:46:30 -0700

Michael Hanna (email@hidden) wrote:
> I've been looking through the classes for something that will let me
> replace the first occurence of a substring in an NSMutableString.
>
> NSMutableString:replaceOccurrencesOfString:
>
> is close but I don't want to replace all, just the FIRST occurence. Any
> suggestions?

Maybe combine replaceOccurrencesOfString:withString:options:range:
with rangeOfString: ?

Get the range of the first occurrence, and then use that range in
replaceOccurrencesOfString:withString:options:range:

-gus

--
August Mueller
http://flyingmeat.com/
VoodooPad - 1st Place U.S., Second O'Reilly Mac OS X Innovaters Contest
"Christmas means carnage!" -- Ferdinand, the duck
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >replaceFirstOccurenceOf? (From: Michael Hanna <email@hidden>)

  • Prev by Date: replaceFirstOccurenceOf?
  • Next by Date: Re: Fw: Dialog disposing problem in Mac OS Ver 10.2.6
  • Previous by thread: replaceFirstOccurenceOf?
  • Next by thread: Re: replaceFirstOccurenceOf?
  • Index(es):
    • Date
    • Thread