• 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: hasSuffix and new line characters.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hasSuffix and new line characters.


  • Subject: Re: hasSuffix and new line characters.
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Thu, 3 Apr 2003 15:30:59 -0500

On Thursday, Apr 3, 2003, at 15:23 US/Eastern, Anthony Duer wrote:

If that is the case, then it is right that it return false, because the string doesn't end with "none", it ends with "none\n"

I've have a string of: "Obvious items: none\n" When I append it to my NSTextView, it creates a new line per the \n on the back of it. However, while I'm processing the string, calling hasSuffix: @"none\n" doesn't seem to return true no matter which way I try it. I tried ever combination I could for it, with/without the \n, nothing worked.

NSString *check = @"Obvious exits: none\n";
NSLog(@"%i", [check hasSuffix: @"none\n"]);

I just ran the following program:

#include <Foundation/Foundation.h>

int main()
{
NSString *check = @"Obvious exits: none\n";
NSLog(@"%d", (int)[check hasSuffix: @"none\n"]);
return 0;
}

And got the following output:

2003-04-03 15:29:48.078 a.out[625] 1

It seems to be working just fine.

--
http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
_______________________________________________
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.

References: 
 >Re: hasSuffix and new line characters. (From: Anthony Duer <email@hidden>)

  • Prev by Date: Re: Bringing an NSTask forward
  • Next by Date: RE: NSStrings obtained from CFStrings
  • Previous by thread: Re: hasSuffix and new line characters.
  • Next by thread: Folder available check
  • Index(es):
    • Date
    • Thread