Say I have a string that looks like this

----
Hello. How are you?
This is the second line.

Fourth line.
----

I'm trying to get each line of the reciever by calling

[string componentsSeparatedByString:@"\n"];

This works fine, but assuming the string is actually laid out like this:

Hello. How are you?\nThis is the second line.\n\nFourth line.

The array contains

@"Hello. How are you?"
@"This is the second line."
@"" (???)
@"Fourth line."

The third line is what I'm having problems with. I would think it would simply be an empty string @"". But,

Both of these:

[stringInQuestion isEqualToString:@""]; //outputs false
[stringInQuestion isEqualToString:@" "]; //also outputs false

output false. Even more puzzling, this

[stringInQuestion length] //outputs 1

outputs 1.

If the length of this mystery string is 1 and it's not a space, what is it???

Any help appreciated!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to