remove start and end spaces from string ruby code example Example: ruby remove whitespace beginning and end ' str '.strip # => 'str'