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

stringByTrimmingCharactersInSet: problem


  • Subject: stringByTrimmingCharactersInSet: problem
  • From: "Tony S. Wu" <email@hidden>
  • Date: Mon, 6 Jan 2003 19:18:47 -0800

I don't know if this is a bug.
If I apply the NSString method stringByTrimmingCharactersInSet: with
NSCharacterSet's whitespaceCharacterSet on a one-character string, the
returned string will be blank.
For example:

NSString *original = [[NSString alloc] initWithString: @"A"];
NSString *tempString = [original stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];

The tempString will become blank.
However, if the receiver has more than 2 characters, the function works
fine.
Is this a bug?
How do i work around with it?
Thanks.

Tony S. Wu
email@hidden

"It takes a smart man to be stupid." ~Tony
_______________________________________________
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.

  • Follow-Ups:
    • Re: stringByTrimmingCharactersInSet: problem
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Addressbook framework without a regular user
  • Next by Date: Re: porting apps from NextStep to Cocoa
  • Previous by thread: Cocoa Text Handling Crashes
  • Next by thread: Re: stringByTrimmingCharactersInSet: problem
  • Index(es):
    • Date
    • Thread