How this will look in ruby?

sorry for asking conversion and not doing it myself(since I've little
to none knowledge of Ruby).
Can somebody translate this code snippent in Ruby?

sub formatfld {
   my $f = shift;
   join('', map(ucfirst, split('_', $f)));
}

thanks in advance.

def format(string)
  string.split(/_/).map { |e| e.capitalize }.join
end

···

On Tue, Aug 26, 2008 at 2:45 AM, adm <avinash.magar@gmail.com> wrote:

sorry for asking conversion and not doing it myself(since I've little
to none knowledge of Ruby).
Can somebody translate this code snippent in Ruby?

sub formatfld {
  my $f = shift;
  join('', map(ucfirst, split('_', $f)));
}

--
Technical Blaag at: http://blog.majesticseacreature.com | Non-tech
stuff at: http://metametta.blogspot.com