Project

General

Profile

Actions

Feature #2323

closed

"Z".."Z".succが空

Added by hasari (Hiro Asari) about 15 years ago. Updated almost 4 years ago.

Status:
Closed
Target version:
-
[ruby-dev:39604]

Description

=begin
surfboard:~$ ruby1.9 -v; ruby1.9 -e 'p ("Z".."Z".succ); p ("Z".."Z".succ).to_a'
ruby 1.9.2dev (2009-11-02 trunk 25625) [x86_64-darwin10.0.0]
"Z".."AA"
[]

"Z".succではなくてもうちょっと”離れた”ヤツをRangeの終わりとして指定すると"AA"はしっかりと入っています。

surfboard:~$ ruby1.9 -e 'p ("Z".."ZA").include? "Z".succ'
true

でも半端な”離れ”方ではいけません。

surfboard:~$ ruby1.9 -e 'p ("Z".."CA").include? "Z".succ'
false

to_aを介しても同様です。

surfboard:~$ ruby1.9 -e 'p ("Z".."ZA").to_a.include? "Z".succ'
true
surfboard:~$ ruby1.9 -e 'p ("Z".."CA").to_a.include? "Z".succ'
false
=end


Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #5607: Inconsistent reaction in Range of StringClosedduerst (Martin Dürst)Actions
Has duplicate Ruby master - Bug #13663: `String#upto` doesn't work as expectedClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0