From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,SPF_PASS,T_DKIM_INVALID shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id DFC552027C for ; Fri, 14 Jul 2017 06:08:02 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7AD23120801; Fri, 14 Jul 2017 15:07:59 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 349A01207F5 for ; Fri, 14 Jul 2017 15:07:56 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=elcNIY+UAKpCLECwHoqiHTy80uM=; b=ADzlyX61DSKBWmC4tU ooQQM/zXpuqAXpGRj7KoyXdIlXMEyFqNb4yURzFMxvMrg4F3JSDz9V95Rv+Dn7Kb 0YswU/8g3hqJ7UsAh91SDOjywtNsMVMb5wnPkdupf43uAN/SwwwBF+xukuFUuIcu zGdiGmxSIcw5/WY/6yb6dqevY= Received: by filter0969p1mdw1.sendgrid.net with SMTP id filter0969p1mdw1-23446-59685FB4-D 2017-07-14 06:07:48.121893212 +0000 UTC Received: from herokuapp.com (ec2-54-92-252-120.compute-1.amazonaws.com [54.92.252.120]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id ktaLPtOORNel36orWDxrNA for ; Fri, 14 Jul 2017 06:07:47.973 +0000 (UTC) Date: Fri, 14 Jul 2017 06:07:49 +0000 (UTC) From: matz@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 57081 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13665 X-Redmine-Issue-Author: sonots X-Redmine-Sender: matz X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5Nmm6m2730ieO4Ggvj79X82iTsRd3B50l+Jl tFVEiS+xCwr8c9v1dmT/MiKH8lJY/+NyOz4KCMMljhFOuqTkbHvEN6/dIehdayGsNqL3ugOEdgeL57 1L1UVrPEGcg1LDcQv4oggtrYfrNDWiBRW5kTdwOdxhS7Gcm8oi53R7y7uQ== X-ML-Name: ruby-core X-Mail-Count: 82045 Subject: [ruby-core:82045] [Ruby trunk Feature#13665] String#delete_suffix X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13665 has been updated by matz (Yukihiro Matsumoto). Looks good to me. Matz. ---------------------------------------- Feature #13665: String#delete_suffix https://bugs.ruby-lang.org/issues/13665#change-65772 * Author: sonots (Naotoshi Seo) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- In https://bugs.ruby-lang.org/issues/12694, we decided to have `String#delete_prefix`. It would be nice to have `String#delete_suffix` method to delete suffix from a string for symmetry although it can be achieved with `String#chomp` as: ```ruby class String def delete_suffix(substr) chomp(substr) end def delete_suffix!(substr) chomp!(substr) end end ``` Any opinions? -- https://bugs.ruby-lang.org/