ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:77163] [Ruby trunk Misc#12730] Documentation String.splice(regex)
       [not found] <redmine.issue-12730.20160906194354@ruby-lang.org>
@ 2016-09-06 19:43 ` cody-soultz
  2016-09-06 19:44 ` [ruby-core:77162] [Ruby trunk Misc#12730] Documentation String.slice!(regex) cody-soultz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: cody-soultz @ 2016-09-06 19:43 UTC (permalink / raw
  To: ruby-core

Issue #12730 has been reported by Cody Soultz.

----------------------------------------
Misc #12730: Documentation String.splice(regex)
https://bugs.ruby-lang.org/issues/12730

* Author: Cody Soultz
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
at http://ruby-doc.org/core-2.2.0/String.html#method-i-slice-21

In the example
string = "this is a string"
string.slice!(/s.*t/)   #=> "sa st"

When ran in irb the result is different than shown because the regex starts at the first s and then ends at the last t.

in irb 
2.3.0 :001 > string = "this is a string"
 => "this is a string" 
2.3.0 :002 > string.slice!(/s.*t/)
 => "s is a st" 

the documentation should be:

string.slice!(/s.*t/)   #=> "s is a st"



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

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

* [ruby-core:77162] [Ruby trunk Misc#12730] Documentation String.slice!(regex)
       [not found] <redmine.issue-12730.20160906194354@ruby-lang.org>
  2016-09-06 19:43 ` [ruby-core:77163] [Ruby trunk Misc#12730] Documentation String.splice(regex) cody-soultz
@ 2016-09-06 19:44 ` cody-soultz
  2016-09-06 19:53 ` [ruby-core:77164] " cody-soultz
  2016-10-14  9:02 ` [ruby-core:77627] [Ruby trunk Misc#12730][Rejected] " hsbt
  3 siblings, 0 replies; 4+ messages in thread
From: cody-soultz @ 2016-09-06 19:44 UTC (permalink / raw
  To: ruby-core

Issue #12730 has been updated by Cody Soultz.

Subject changed from Documentation String.splice(regex) to Documentation String.slice!(regex)

----------------------------------------
Misc #12730: Documentation String.slice!(regex)
https://bugs.ruby-lang.org/issues/12730#change-60380

* Author: Cody Soultz
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
at http://ruby-doc.org/core-2.2.0/String.html#method-i-slice-21

In the example
string = "this is a string"
string.slice!(/s.*t/)   #=> "sa st"

When ran in irb the result is different than shown because the regex starts at the first s and then ends at the last t.

in irb 
2.3.0 :001 > string = "this is a string"
 => "this is a string" 
2.3.0 :002 > string.slice!(/s.*t/)
 => "s is a st" 

the documentation should be:

string.slice!(/s.*t/)   #=> "s is a st"



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

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

* [ruby-core:77164] [Ruby trunk Misc#12730] Documentation String.slice!(regex)
       [not found] <redmine.issue-12730.20160906194354@ruby-lang.org>
  2016-09-06 19:43 ` [ruby-core:77163] [Ruby trunk Misc#12730] Documentation String.splice(regex) cody-soultz
  2016-09-06 19:44 ` [ruby-core:77162] [Ruby trunk Misc#12730] Documentation String.slice!(regex) cody-soultz
@ 2016-09-06 19:53 ` cody-soultz
  2016-10-14  9:02 ` [ruby-core:77627] [Ruby trunk Misc#12730][Rejected] " hsbt
  3 siblings, 0 replies; 4+ messages in thread
From: cody-soultz @ 2016-09-06 19:53 UTC (permalink / raw
  To: ruby-core

Issue #12730 has been updated by Cody Soultz.


James Britt Pointed out to me that:

> The example in the docs shows a sequence of operations on the same string instance. "slice!" will modify the receiver, so the next operation is working on a changed string.
> 
> Your example doesn't match what is happening in the docs, so the results are different. In the docs example there are two previous calls to "slice!"

So this issue should now be closed. I do not see how to close this...sorry

----------------------------------------
Misc #12730: Documentation String.slice!(regex)
https://bugs.ruby-lang.org/issues/12730#change-60381

* Author: Cody Soultz
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
at http://ruby-doc.org/core-2.2.0/String.html#method-i-slice-21

In the example
string = "this is a string"
string.slice!(/s.*t/)   #=> "sa st"

When ran in irb the result is different than shown because the regex starts at the first s and then ends at the last t.

in irb 
2.3.0 :001 > string = "this is a string"
 => "this is a string" 
2.3.0 :002 > string.slice!(/s.*t/)
 => "s is a st" 

the documentation should be:

string.slice!(/s.*t/)   #=> "s is a st"



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

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

* [ruby-core:77627] [Ruby trunk Misc#12730][Rejected] Documentation String.slice!(regex)
       [not found] <redmine.issue-12730.20160906194354@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2016-09-06 19:53 ` [ruby-core:77164] " cody-soultz
@ 2016-10-14  9:02 ` hsbt
  3 siblings, 0 replies; 4+ messages in thread
From: hsbt @ 2016-10-14  9:02 UTC (permalink / raw
  To: ruby-core

Issue #12730 has been updated by Hiroshi SHIBATA.

Status changed from Open to Rejected

----------------------------------------
Misc #12730: Documentation String.slice!(regex)
https://bugs.ruby-lang.org/issues/12730#change-60896

* Author: Cody Soultz
* Status: Rejected
* Priority: Normal
* Assignee: 
----------------------------------------
at http://ruby-doc.org/core-2.2.0/String.html#method-i-slice-21

In the example
string = "this is a string"
string.slice!(/s.*t/)   #=> "sa st"

When ran in irb the result is different than shown because the regex starts at the first s and then ends at the last t.

in irb 
2.3.0 :001 > string = "this is a string"
 => "this is a string" 
2.3.0 :002 > string.slice!(/s.*t/)
 => "s is a st" 

the documentation should be:

string.slice!(/s.*t/)   #=> "s is a st"



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

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

end of thread, other threads:[~2016-10-14  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-12730.20160906194354@ruby-lang.org>
2016-09-06 19:43 ` [ruby-core:77163] [Ruby trunk Misc#12730] Documentation String.splice(regex) cody-soultz
2016-09-06 19:44 ` [ruby-core:77162] [Ruby trunk Misc#12730] Documentation String.slice!(regex) cody-soultz
2016-09-06 19:53 ` [ruby-core:77164] " cody-soultz
2016-10-14  9:02 ` [ruby-core:77627] [Ruby trunk Misc#12730][Rejected] " hsbt

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