ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: sonots@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:81772] [Ruby trunk Feature#13665] String#delete_suffix
Date: Mon, 26 Jun 2017 04:54:59 +0000	[thread overview]
Message-ID: <redmine.journal-65469.20170626045459.92eb8817eb864e8b@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13665.20170616143016@ruby-lang.org

Issue #13665 has been updated by sonots (Naotoshi Seo).


I've sent a PR https://github.com/ruby/ruby/pull/1661.
I will merge if I get agreement at a ruby developer's meeting.

----------------------------------------
Feature #13665: String#delete_suffix
https://bugs.ruby-lang.org/issues/13665#change-65469

* 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/

  parent reply	other threads:[~2017-06-26  4:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-13665.20170616143016@ruby-lang.org>
2017-06-16 14:30 ` [ruby-core:81714] [Ruby trunk Feature#13665] String#delete_suffix sonots
2017-06-16 22:34 ` [ruby-core:81716] " nobu
2017-06-21  8:42 ` [ruby-core:81735] " shevegen
2017-06-26  4:54 ` sonots [this message]
2017-07-14  6:07 ` [ruby-core:82045] " matz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-65469.20170626045459.92eb8817eb864e8b@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).