From: shevegen@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:81735] [Ruby trunk Feature#13665] String#delete_suffix
Date: Wed, 21 Jun 2017 08:42:51 +0000 [thread overview]
Message-ID: <redmine.journal-65435.20170621084250.6c031308df24ad6d@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13665.20170616143016@ruby-lang.org
Issue #13665 has been updated by shevegen (Robert A. Heiler).
I think the method's functionality is good to have.
----------------------------------------
Feature #13665: String#delete_suffix
https://bugs.ruby-lang.org/issues/13665#change-65435
* 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/
next prev parent reply other threads:[~2017-06-21 8:43 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 ` shevegen [this message]
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.journal-65435.20170621084250.6c031308df24ad6d@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).