From: Nobuyoshi Nakada Date: 2007-06-20T10:03:31+09:00 Subject: Re: Check for text file Hi, At Wed, 20 Jun 2007 08:22:51 +0900, Daniel DeLorme wrote in [ruby-talk:256241]: > Still, I have to say I was surprised; I didn't know that a hyphen in > String#count had the same effect as in a regexp character class. Talk > about an undocumented feature! It's documented. It can be s.count("^\t\n -~").to_f/s.size>0.3 -- Nobu Nakada