ObjectiveSugar icon indicating copy to clipboard operation
ObjectiveSugar copied to clipboard

feature request: nsstring isEmpty

Open mgerlach-klick opened this issue 11 years ago • 4 comments

Would you consider adding an [NSString isEmpty] as described here: http://stackoverflow.com/a/899320 ?

mgerlach-klick avatar Jul 23 '13 13:07 mgerlach-klick

I think, that isEmpty written this way is more like a method for something more general like NSObject. It is too expensive for NSString exclusively, isn't it?

stanislaw avatar Jul 23 '13 14:07 stanislaw

Also, if we do know that thing responds to length and count - then why those casts to NSData and NSArray respectively?

stanislaw avatar Jul 23 '13 14:07 stanislaw

That's true, I was mainly thinking of using it for nsstring, but this is really something for NSObject. Perhaps with the added [NSNull null] check mentioned in the comments?

BTW since I have you here: I love your library, thanks for your work!

mgerlach-klick avatar Jul 23 '13 14:07 mgerlach-klick

We can adopt something like Brent Simmon's emptiness functions http://inessential.com/2012/07/28/emptiness

florianbuerger avatar Nov 03 '13 10:11 florianbuerger