pastebin

Paste Search Dynamic
Recent pastes
check_int(a) a.match
  1. def check_int(a)
  2.         if not (a.is_a? integer or a.match(/^[1-9][0-9]*/))
  3.                 print("no\r\n")
  4.         else
  5.                 print("yes\r\n")
  6.         end
  7. end
  8.  
  9. check_int(12)
  10. check_int(-12)
  11. check_int("12")
  12. check_int("-12")
  13. check_int("qwe8921")
  14. check_int("08923")
Parsed in 0.004 seconds