in reply to making first letter of all words in array upper case
Thanks to SuperCruncher, I have gotten the "From:" name field to have all uppercase first characters, but can't get the same to happen for the "To:" name field to do the same. I know it has something to do with the $_ variable (I think?)
# make the first letters of the NAME of the sender uppercase my @from = split(/ /, $from); $_ = ucfirst for @from; # make the first letters of the NAME of the receiver uppercase my @to = split(/ /, $to); $_ = ucfirst for @to; # make the first letter of the message upper case $message = ucfirst($message);
As for using a regex for the next part, I am lost :(
How can I use this line: $string .= '.' if $string !~ /[.!?]$/; in the code below?
############################################## # puts a period at the end of senders message, # if one was not there, AND, if there is no # question OR explanation mark. my $length = length($message); my $period = index($message, "."); my $question = index($message, "?"); my $explanation = index($message, "!"); $length = $length - 1; if (($period ne $length) && ($question ne $length) && ($explanation ne + $length)) { $message = $message.'.'; } ##############################################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: making first letter of all words in array upper case
by sauoq (Abbot) on Dec 31, 2002 at 20:33 UTC |