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:81714] [Ruby trunk Feature#13665] String#delete_suffix
Date: Fri, 16 Jun 2017 14:30:16 +0000	[thread overview]
Message-ID: <redmine.issue-13665.20170616143016.7f1229ef9f812670@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13665.20170616143016@ruby-lang.org

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

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

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

```
class String
  def delete_suffix(substr)
    chomp(substr)
  end
  def delete_suffix!(substr)
    chomp!(substr)
  end
end
```

Any opinions?



-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2017-06-16 14:30 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 ` sonots [this message]
2017-06-16 22:34 ` [ruby-core:81716] [Ruby trunk Feature#13665] String#delete_suffix nobu
2017-06-21  8:42 ` [ruby-core:81735] " shevegen
2017-06-26  4:54 ` [ruby-core:81772] " sonots
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.issue-13665.20170616143016.7f1229ef9f812670@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).