Ruby / Formatting with String Methods


#1

i managed to trick things out by not adding the "!" at the end of the method and / or at the end of puts command ,and everything worked properly! i don't really see the reason why we use it or that we have to and why we can't. i didn't understood what is its role actually so please the question is the following :
what is the purpose of using the "!" at any circumstances?


#2

The Exclamation sign in Ruby is used for certain methods to call the method, and assign it to the value of the original variable. Say we initialise a variable:

hello = "Hello"

hello.upcase!

is the same as

hello = hello.upcase