From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 500FF1AC01D8 for ; Wed, 24 Aug 2016 14:02:01 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 0FFC9B5D8EA for ; Wed, 24 Aug 2016 14:35:01 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 9A96118CC819 for ; Wed, 24 Aug 2016 14:35:01 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8438D120439; Wed, 24 Aug 2016 14:34:59 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id CF834120411 for ; Wed, 24 Aug 2016 14:34:55 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=je6PMlFvxn/ir7Mf03BY/odLr0I=; b=ROBuiRGfE3qxHBfT+N g3NHBTFjHpUIqng3VfXKDLxtKmZxmiUXs/iBPcXYk0mwJ4REXzloYswCwrAaa5kO zDu78UVACeFoqA6jl01gaWYsz/PrlgiDWxxwp+5PWkUVx3e0j+K+xZwaJJp5Ig82 6/bJ+Tyi261pnUH0nSZkWAYlU= Received: by filter0535p1mdw1.sendgrid.net with SMTP id filter0535p1mdw1.28161.57BD31F936 2016-08-24 05:34:49.648151468 +0000 UTC Received: from herokuapp.com (ec2-54-147-235-155.compute-1.amazonaws.com [54.147.235.155]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id NyJfaHexSCKSZ0ima1Pu0g for ; Wed, 24 Aug 2016 05:34:49.808 +0000 (UTC) Date: Wed, 24 Aug 2016 05:34:49 +0000 From: sonots@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 51822 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 12694 X-Redmine-Issue-Author: sonots X-Redmine-Sender: sonots 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS51L2830RVevGih/I/cfE18Fh09HH4PYdhDja pGL8AdCHomtbXmNSwOtItxCQDHhqvn3jA4Ti44nknGC/AeSIYjmOBYHvBtGA2budfB7a9NMej1FJt8 EIFX7NJgCppD0jS0g/Rj/9x6KjjeRusgfa5U X-ML-Name: ruby-core X-Mail-Count: 77032 Subject: [ruby-core:77032] [Ruby trunk Feature#12694][Rejected] Want a String method to remove heading substr 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 #12694 has been updated by Naotoshi Seo. Status changed from Open to Rejected I will continue this issue on https://bugs.ruby-lang.org/issues/6842, let me close. ---------------------------------------- Feature #12694: Want a String method to remove heading substr https://bugs.ruby-lang.org/issues/12694#change-60259 * Author: Naotoshi Seo * Status: Rejected * Priority: Normal * Assignee: ---------------------------------------- I often write codes like: ```ruby str = 'abcdef' substr = 'abc' str[substr.size..-1] if str.index(substr) == 0 #=> 'def' # or str.sub(/^#{substr}/, '') #=> 'def' ``` I want a short hand which is something like: ```ruby str = 'abcdef' substr = 'abc' str.rstrip(substr) #=> 'def' ``` Having similar argument for `String#lstrip` would be nice for symmetry although we already have `String#chomp(substr)` -- https://bugs.ruby-lang.org/