概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Ruby 2.5 added delete_prefix and delete_suffix methods 原文公開日: 2017/11/28 著者: Amit Choudhary サイト: BigBinary Blog 本記事は、BigBinaryのRuby 2.5シリーズのひとつです。 先ごろRuby 2.5.0-preview1がリリースされました。 Ruby 2.4の場合 Projects::CategoriesControllerという文字列があり、Controllerという文字を削除したいとします。このような場合は#chompメソッドを使えます。 irb> "Projects::CategoriesController".chomp("Controller") => "Projects::Categories" しか