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,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD 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 D90051FA7B for ; Fri, 16 Jun 2017 22:34:32 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4189E1207E1; Sat, 17 Jun 2017 07:34:29 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 71F301207D7 for ; Sat, 17 Jun 2017 07:34:27 +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=bt605kXNlHcrXnbyeD7k2alQ6FE=; b=NvjKH1KIdb78FK3lcx rpw1Hr5xA5AKosl6kxuQh/kb1v+P2RnVbSeHNpGI8M5/UBuD9jKxlltOlMChVm8K DbUpzaY8HPDFmnzyeBL7BDGFowEhkqRmLq3XWxcnAE7ntyCdRVLgERdmguu/x9Gm H8IEedG5TVn4QnuMF6IU32k94= Received: by filter1121p1mdw1.sendgrid.net with SMTP id filter1121p1mdw1-32374-59445CEB-11 2017-06-16 22:34:19.177635955 +0000 UTC Received: from herokuapp.com (ec2-54-198-116-159.compute-1.amazonaws.com [54.198.116.159]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id XH8vNfVpSp6O093647XDoA for ; Fri, 16 Jun 2017 22:34:19.142 +0000 (UTC) Date: Fri, 16 Jun 2017 22:34:18 +0000 From: nobu@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56745 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13665 X-Redmine-Issue-Author: sonots X-Redmine-Sender: nobu 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS5PQlnmKgyvpdiW6EpAlfrigILM9HeP3TmX7i YUD+MTvlU1FP2dn/T83jNS6oU3WDQsioaxGABaFMa5cpuKDjBResSf1IkxdPVzAXasKD8iztKSRGnR /XliPizRGxmPiWVNXsdJn0FUtI0hbYzO3DkEL0jVXn6Rlgh0I2pmTQN/5A== X-ML-Name: ruby-core X-Mail-Count: 81716 Subject: [ruby-core:81716] [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 nobu (Nobuyoshi Nakada). Description updated At yesterday meeting, a name `lchomp` was proposed but rejected because of the special deal of CR LF. If `delete_suffix` will be introduced, it should keep CR before LF when the argument is LF only, as well as `delete_prefix`. ---------------------------------------- Feature #13665: String#delete_suffix https://bugs.ruby-lang.org/issues/13665#change-65415 * 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/