Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
how this will look in ruby?
adm
8/26/2008 6:45:00 AM
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.
1 Answer
Gregory Brown
8/26/2008 6:55:00 AM
0
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)));
> }
def format(string)
string.split(/_/).map { |e| e.capitalize }.join
end
--
Technical Blaag at:
http://blog.majesticseacr...
| Non-tech
stuff at:
http://metametta.bl...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
how this will look in ruby?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password