how this will look in ruby?

A

adm

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.
 
G

Gregory Brown

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)));
}

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top