Project

General

Profile

Actions

Bug #515

closed

String#rindexが期待通りに動かない

Added by xibbar (Takeyuki FUJIOKA) over 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
Backport:
[ruby-dev:36033]

Description

=begin

-- coding: utf-8 --

str="原稿システム原稿原稿

"
p str.size
p str.rindex(/<DT/,str.size)

% ruby -Ku /tmp/jikken2.rb
35
30
% ruby19 /tmp/jikken2.rb
14
nil

となり、nilになります。ただ、

-- coding: utf-8 --

str="原稿

"
p str.size
p str.rindex(/<DT/,str.size)

% ruby19 /tmp/jikken2.rb
6
2

これだと動きます。
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0