#!/usr/bin/perl -w my $TS = "THIS INPUT IS IN ALL CAPS"; my $lc_ts = lc($TS); my @words = split(/\s+/, $lc_ts); my @letters = (); foreach my $word(@words) { chomp($word); if($word =~ /^(\w{1})(\w*)/) { print uc($1) . $2 . " "; } else { die "Something is seriously wrong here..."; } }
# OUTPUT I GOT FROM THIS: This Input Is In All Caps ----- Scot Robnett inSite Internet Solutions Square West Center 454 West Jackson Street Woodstock, IL 60098 (815)206-2907 office (815)790-9687 mobile [EMAIL PROTECTED] http://www.insiteful.tv http://www.mawebcenters.com/insite2000 -----Original Message----- From: Sara [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 11:59 AM To: org Subject: Another Regex question. $TS = "THIS INPUT IS IN ALL CAPS"; $TS_cont = lc $TS; $TS now prints out "this input is in all caps" What If I want first letter in caps for every word in string? which should be "This Input Is In All Caps" TIA, Sara.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]