Friday 29 June 2018

ruby on rails - When to use nil, blank, empty?




Is there any guidelines on how to differentiate between .nil?, .blank? and .empty??



I'm generally always confused as to when to use them in my application as they all seem to mean the same thing but have different meanings.




Does anyone have any cheat sheet on the gory details?


Answer




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...