Ruby / Formatting with String Methods


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?


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"


is the same as

hello = hello.upcase