Closed anomaly2104 closed 9 years ago
@chaitanyagupta Yes that was not the intended purpose of the method. It was only required because we used to get both blank strings and missing values in JSON responses from certain API calls (or from the SSC maybe), and this method was useful in normalizing them.
Also, I agree that moving the (modified) method into Chocolate might be premature. @uditiiita You should see if other such use cases arise before reconsidering moving this to Chocolate.
However, the current method could certainly be named better. I've opened an issue around this (https://github.com/talk-to/Chocolate/issues/73). @uditiiita If you find your modified method useful after a while also then comment on that issue and we will see which alternative we can use.
I made this change because in the documentation of "tdt_stringByNillingBlanks", it is written that @return
nilif the receiver is blank, otherwise returns the receiver.
I consider both @""
and @" "
as blank. May be we should also add one more line of documentation there defining our defining our own meaning of blank for that method.
Closing this PR!
I don't think that's the intended purpose of this method. @mx4492 can clarify, but I would suggest creating a new method for this (and its not necessarily required in Chocolate).