messy = " padded " # strip trims whitespace from both ends p messy.strip # chomp removes a trailing newline p "line\n".chomp
strip and chomp