in reply to Correct case
This should do what you want:
Note that I didn't test this and that it will replace multiple spaces between words with a single one. Basically, the ucfirst function is applied to each word in the list obtained by splitting the original string. After that, that list is join together again.my $upcased = join(" ", map(ucfirst($_), split(/\s+/, $str)));
Hope this helps, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Correct case
by Zaxo (Archbishop) on Jan 13, 2003 at 16:34 UTC | |
|
Re: Re: Correct case
by dragonchild (Archbishop) on Jan 13, 2003 at 16:35 UTC |