How to understand nil vs. empty vs. blank in Ruby

后端 未结 14 1247
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 07:28

I find myself repeatedly looking for a clear definition of the differences of nil?, blank?, and empty? in Ruby on Rails. Here\'s the

14条回答
  •  日久生厌
    2020-11-22 07:45

    One difference is that .nil? and .empty? are methods that are provided by the programming language Ruby, whereas .blank? is something added by the web development framework Rails.

提交回复
热议问题