Categories
How to check if a variable is empty in Ruby?
Actually the question is in the title) #receiving a string from the user user_input = gets.chomp if user_input is empty? code end
Answer the question
In order to leave comments, you need to log in
This language is cool... Ruby)) As you think - so you write) You can check the variable for emptiness using the .empty method ))
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question