• 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: cocoa-dev digest, Vol 2 #2580 - 11 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #2580 - 11 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #2580 - 11 msgs
  • From: "Ujwal S. Sathyam" <email@hidden>
  • Date: Tue, 01 Jul 2003 22:48:03 -0700

That's a known bug.

Ujwal


Message: 2
Date: Tue, 1 Jul 2003 16:40:22 -0700
From: Gus Mueller <email@hidden>
To: email@hidden
Subject: NSString stringByTrimmingCharactersInSet: strangeness

I just noticed something that I thought was odd about the
stringByTrimmingCharactersInSet method in NSString-

I've got the following code (sorry for the formatting):

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog(@"trimed is: '%@'",
[@"s" stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]]
);
[pool release];
return 0;
}

and it gives me the output:

2003-07-01 18:35:31.816 strtest[9480] trimed is: ''

... that seems a little weird- I figured it would just return the "s"
again, not an empty string.. I read the docs on
stringByTrimmingCharactersInSet and it suggests that what I'm thinking
is correct, but the output isn't. If I use the string "ss", everything
works fine, but a variation in the single s (" s") isn't.

Can anybody shed some light on this? Do I misunderstand this api?

thanks,

-gus
_______________________________________________
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.

  • Prev by Date: Re: Strong language about Cocoa and Qt.
  • Next by Date: Re: Strong language about Cocoa and Qt.
  • Previous by thread: IPv6 on WebKit
  • Next by thread: Merging BezierPath
  • Index(es):
    • Date
    • Thread