• 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: Fastest/smallest search+replace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fastest/smallest search+replace


  • Subject: Re: Fastest/smallest search+replace
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 14 May 2001 15:16:40 -0700

On Monday, May 14, 2001, at 02:01 PM, Ali Ozer wrote:

In any case, looks like this might be good functionality to include in
NSString.

Yes, and while you're at it, how about a good selection of the rest of the string-bashing functionality that Perl or Python offer? In particular, the tr/// operator would be *very* nice to have, and a "NSRegex" class that kept the compiled expressions around would be a nice addition to the NSScanner functionality.

nameExpression = [[NSRegex alloc] initWithPattern:@"[A-Za-z]*"];

[myScanner scanPattern:nameExpression intoString:&nameString];

[myMutableString searchForPattern:nameExpression andReplaceWithString:@"Some Other Name"];

-jcr

[Objc retain];


  • Follow-Ups:
    • Re: Fastest/smallest search+replace
      • From: Greg Titus <email@hidden>
References: 
 >Re: Fastest/smallest search+replace (From: Ali Ozer <email@hidden>)

  • Prev by Date: Re: Volume Tracking in Cocoa without Carbon?
  • Next by Date: Re: Volume Tracking in Cocoa without Carbon?
  • Previous by thread: Re: Fastest/smallest search+replace
  • Next by thread: Re: Fastest/smallest search+replace
  • Index(es):
    • Date
    • Thread