test a string to see if it is empty with empty? : String.new « String « Ruby






test a string to see if it is empty with empty?


title = String.new # => ""
title.empty? # => true

 








Related examples in the same category

1.Creating Strings
2.test a string to see if it is empty before you process it
3.length and size methods both return an integer indicating how many characters a string holds.
4.The new method can take a string argument