secret
Last active

Stackoverflow: use of ! in Ruby (#16628668)

  • Download Gist
bang.rb
Ruby
1 2 3 4 5 6 7 8 9
print "Please Enter your Input: "
user_input = gets.chomp
user_input.downcase!
puts user_input
 
print "Please Enter your Input: "
user_input = gets.chomp
user_input.downcase
puts user_input
console output
1 2 3 4 5
$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
$ echo -en "HALLO\nHALLO" | ruby bang.rb
Please Enter your Input: hallo
Please Enter your Input: HALLO

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.