Hi -- On Wed, 26 Mar 2008, David A. Black wrote: > Hi -- > > On Wed, 26 Mar 2008, Martin DeMello wrote: > >> On Tue, Mar 25, 2008 at 2:16 PM, James Gray <james / grayproductions.net> >> wrote: >>> >>> I didn't really golf it, but my answer is: >> >> You have a point - I wasn't looking for golf so much as for neat >> and/or offbeat approaches to the problem of counting the tabs. > > Darn, I took you literally :-) > > def t(s)b='*-ox';s.map{|l|c=l.count("\t") > (c-1).times{l.sub!(/\t/,' ')} Whoops, that should be ' ' (two spaces). David -- Rails training from David A. Black and Ruby Power and Light: ADVANCING WITH RAILS April 14-17 New York City INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin See http://www.rubypal.com for details and updates!