On Wed, Jan 27, 2010 at 1:19 PM, Carl Mäsak <cma...@gmail.com> wrote: > Mark (>), Carl (>>): >>> S05 describes tr/// in terms of the .trans function, a handsome but >>> very different beast. Specifically, it doesn't seem to have a "scalar >>> context", with which one could count things. >> >> What does trans return in numeric (+) context? > > As spec'd, it returns the numification of the string resulting from > the substitution, I guess. > > // Carl >
$str.comb(/C|G/).join('').chars might do it. It's maybe not quite as elegant... Matt