Check out example codes for "ruby string trmi". It will help you in understanding the concepts better.
Code Example 1
>> @title = "abc"
=> "abc"
>> @title.strip!
=> nil
>> @title
=> "abc"
>> @title = " abc "
=> " abc "
>> @title.strip!
=> "abc"
>> @title
=> "abc"
Learn ReactJs, React Native from akashmittal.com