Ruby 1.9 doesn't hace String#any?

  • Thread starter Iñaki Baz Castillo
  • Start date
I

Iñaki Baz Castillo

Hi, I'm trying:
ruby 1.9.0 (2007-08-30 patchlevel 0) [i486-linux]
in Ubuntu.

I've realized that there is no method String#any?
Why? maybe it exists in a more recent version of 1.9?
Which would be the replacement method if not?

Thanks.

=2D-=20
I=C3=B1aki Baz Castillo
 
I

Iñaki Baz Castillo

El Viernes, 27 de Febrero de 2009, I=C3=B1aki Baz Castillo escribi=C3=B3:
Hi, I'm trying:
ruby 1.9.0 (2007-08-30 patchlevel 0) [i486-linux]
in Ubuntu.

I've realized that there is no method String#any?
Why? maybe it exists in a more recent version of 1.9?
Which would be the replacement method if not?

Ok I've found that in Ruby 1.9 String is no more an Enumerable (and "any?" =
is=20
defined in Enumerable module).

=2D-=20
I=C3=B1aki Baz Castillo
 
G

Gregory Brown

El Viernes, 27 de Febrero de 2009, I=F1aki Baz Castillo escribi=F3:
Hi, I'm trying:
=A0 ruby 1.9.0 (2007-08-30 patchlevel 0) [i486-linux]
in Ubuntu.

I've realized that there is no method String#any?
Why? maybe it exists in a more recent version of 1.9?
Which would be the replacement method if not?

Ok I've found that in Ruby 1.9 String is no more an Enumerable (and "any?= " is
defined in Enumerable module).

Right, so you just need to be specific about what you want to enumerate ove=
r:
=3D> "a"


-greg

--=20
Technical Blaag at: http://blog.majesticseacreature.com
Non-tech stuff at: http://metametta.blogspot.com
"Ruby Best Practices" Book now in O'Reilly Roughcuts:
http://rubybestpractices.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top