...

/

Bangs

Bangs

Learn about the bang methods in Ruby.

Bang methods

All the examples we’ve discussed before are questions and don’t modify the object they’re called on.

Press + to interact
Ruby
name = "Ruby Monstas"
puts name.downcase
puts name

If we run the lines of code above, the downcase method returns a new lowercase version of the original string. When we output the original string on the next line, we can then see that it’s still the ...