ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:81714] [Ruby trunk Feature#13665] String#delete_suffix
       [not found] <redmine.issue-13665.20170616143016@ruby-lang.org>
@ 2017-06-16 14:30 ` sonots
  2017-06-16 22:34 ` [ruby-core:81716] " nobu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: sonots @ 2017-06-16 14:30 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:81716] [Ruby trunk Feature#13665] String#delete_suffix
       [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 ` nobu
  2017-06-21  8:42 ` [ruby-core:81735] " shevegen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: nobu @ 2017-06-16 22:34 UTC (permalink / raw)
  To: 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:81735] [Ruby trunk Feature#13665] String#delete_suffix
       [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
  2017-06-26  4:54 ` [ruby-core:81772] " sonots
  2017-07-14  6:07 ` [ruby-core:82045] " matz
  4 siblings, 0 replies; 5+ messages in thread
From: shevegen @ 2017-06-21  8:42 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:81772] [Ruby trunk Feature#13665] String#delete_suffix
       [not found] <redmine.issue-13665.20170616143016@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2017-06-21  8:42 ` [ruby-core:81735] " shevegen
@ 2017-06-26  4:54 ` sonots
  2017-07-14  6:07 ` [ruby-core:82045] " matz
  4 siblings, 0 replies; 5+ messages in thread
From: sonots @ 2017-06-26  4:54 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:82045] [Ruby trunk Feature#13665] String#delete_suffix
       [not found] <redmine.issue-13665.20170616143016@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2017-06-26  4:54 ` [ruby-core:81772] " sonots
@ 2017-07-14  6:07 ` matz
  4 siblings, 0 replies; 5+ messages in thread
From: matz @ 2017-07-14  6:07 UTC (permalink / raw)
  To: ruby-core

Issue #13665 has been updated by matz (Yukihiro Matsumoto).


Looks good to me.

Matz.


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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-14  6:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 ` [ruby-core:81772] " sonots
2017-07-14  6:07 ` [ruby-core:82045] " matz

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).