Re: Probably a dumb s/// question.
From: Glenn Jackman (xx087_at_freenet.carleton.ca)
Date: 03/16/05
- Previous message: Paul Lalli: "Re: Probably a dumb s/// question."
- In reply to: Mark Healey: "Probably a dumb s/// question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 16 Mar 2005 16:51:18 GMT
At 2005-03-16 11:14AM, Mark Healey <die@spammer.die> wrote:
> For example I'd like to turn
> the quick brown fox jumped over the lazy dogs.
> to
> The Quick Brown Fox Jumped Over the Lazy Dogs.
>
> Is this doable on a single line?
my $string = 'the quick brown fox jumped over the lazy dogs.';
my $String = join ' ', map {ucfirst lc} split ' ', $string;
That forces your string to lower case first then capitalizes the first
letter. It won't preserve whitespace though.
-- Glenn Jackman NCF Sysadmin glennj@ncf.ca
- Previous message: Paul Lalli: "Re: Probably a dumb s/// question."
- In reply to: Mark Healey: "Probably a dumb s/// question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|