From: Brian Candler Date: 2012-12-22T00:56:34+09:00 Subject: Re: A stupid question? Al Baker wrote in post #1089770: > I'm trying to find a way to count the consonants in a sentence. how > would i go about that? i tried to use length - [aeiou]. but never got > the result i was looking for >> str = 'Hello, world!?' >> str.scan(/[a-df-hj-np-tv-z]/i).size => 7 >> str.gsub(/[^a-df-hj-np-tv-z]/i,'').size => 7 -- Posted via http://www.ruby-forum.com/.