String#stripは文字列前後の空白を削除します。 " Hello, world! ".strip #=> "Hello, world!" String#strip!は文字列前後の空白を削除します(破壊的メソッド)。 >> " Hello, world! ".strip => "Hello, world!" >> "\t\t\tHello, world!\n\n\n".strip => "Hello, world!" >> s = " Hello, world! " => " Hello, world! " >> s => " Hello, world! " >> s.strip => "Hello, world!" >> s => " Hello, world! " # String#strip は非破壊的 >> s.strip! => "Hello, world!" >> s =