in reply to Mixing the case of a line
You should probably read about uc, lc, and ucfirst.#!/usr/bin/perl -wT use strict; my $string = 'abc def GHI JkLMno pQrSTUv'; my @words = map {ucfirst(lc($_))} split(' ',$string); # Abc Def, etc. +.. $words[-1] = uc($words[-1]); # PQRSTUV my $newstring = join(' ',@words); # back together print "$newstring\n"; __END__ =head1 OUTPUT Abc Def Ghi Jklmno PQRSTUV
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Mixing the case of a line
by Joes (Acolyte) on Nov 16, 2001 at 06:43 UTC |