Oops,

2011/7/18 Yusuke ENDOH <mame / tsg.ne.jp>:
>> Or just the first element that matches?
>
> Good question :-) =A0Interestingly, break can be used.
>
> =A0ary =3D [0, 4, 7, 10, 12]
> =A0p (0..4).bsearch {|i| break i if ary[i] >=3D 4 }
> =A0 =A0#=3D> 1, 2, 3 or 4 (probably 2, but I don't think it might be chan=
ged
> =A0 =A0 =A0 =A0in future extension)


=A0 =A0#=3D> 1, 2, 3 or 4 (probably 2, but <strike>I don't think</strike> i=
t
might be changed
=A0 =A0 =A0 =A0in future extension)

--=20
Yusuke Endoh <mame / tsg.ne.jp>