[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...
Issue #16694 has been reported by vo.x (Vit Ondruch).
11 messages
2020/03/18
[ruby-core:97318] [Ruby master Feature#16666] 'string' - 'str' as a shortcut for 'string'.gsub('str', '')?
From:
sawadatsuyoshi@...
Date:
2020-03-01 07:07:07 UTC
List:
ruby-core #97318
Issue #16666 has been updated by sawa (Tsuyoshi Sawada).
For removing a set of characters, there is already `String#delete`. And for your other cases, there is a similar proposal https://bugs.ruby-lang.org/issues/12698.
----------------------------------------
Feature #16666: 'string' - 'str' as a shortcut for 'string'.gsub('str', '')?
https://bugs.ruby-lang.org/issues/16666#change-84442
* Author: vladpisanov (Vlad Pisanov)
* Status: Open
* Priority: Normal
----------------------------------------
Sorry if this has been brought up before, but I couldn't find anything.
I love how we can substract arrays (`[1,2,3] - [1,2]`). Does anyone else think the same syntax would be beneficial for Strings?
Some possible scenarios could be:
```ruby
'string' - 'str' # Remove substring
'string' - ['s', 't'] # Remove a set of characters
'string' - /^st/ # Remove by regexp
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>