Skip navigation.
 
mlstringByTrimmingCharactersInSet
FROM : Jacob Engstrand
DATE : Fri Nov 22 16:22:54 2002

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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlstringByTrimmingCharactersInSet Jacob Engstrand Nov 22, 16:22
mlRe: stringByTrimmingCharactersInSet Clark S. Cox III Nov 22, 16:38