Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if s.empty?
  2.   "The string is empty"
  3. else
  4.   "The string is not empty"
  5. end
  6.  
  7. if x.empty? && y.empty?                       #and
  8.   puts "Both strings are empty"            
  9. end
  10.  
  11. if x.empty? || y.empty?
  12.   puts "One string is empty"                     #or
  13. end
  14.  
  15. unless x.empty?
  16.   puts "x is not empty"
  17. end