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

stringByTrimmingCharactersInSet


  • Subject: stringByTrimmingCharactersInSet
  • From: Jacob Engstrand <email@hidden>
  • Date: Fri, 22 Nov 2002 16:22:54 +0100

Hi All,

NSString *before = @"ab";
NSLog(@"before: '%@'", before);
NSString *after = [before stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]];
NSLog(@"after: '%@'", after);

The above piece of code outputs:

before: 'ab'
after: 'ab'

Which is ok, of course. But changing the first line to:

NSString *before = @"a";

gives the following output:

before: 'a'
after: ''

What gives? Is it me? Am I loosing it? Or is this some bug that everybody knows about but I?

/jak


____________________________________________________________
Buy Nothing Day: November 30, 2002 (November 29 in the USA).

The intent of the Buy Nothing Day is to provide a period of
respite and a pause for reflection from the rigors of the
consumption economy, which is the main thing that dominates
the media and perhaps a few too many of our daily life
choices and aspirations.

http://www.buynothingday.co.uk/
_______________________________________________
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
      • From: "Clark S. Cox III" <email@hidden>
  • Prev by Date: Re: more on stable sorting...
  • Next by Date: Creating your own genie effect
  • Previous by thread: Re: multiple componentsSeparatedByString
  • Next by thread: Re: stringByTrimmingCharactersInSet
  • Index(es):
    • Date
    • Thread