RE: change char, keep case

2005-06-20 Thread Luke, David
Several people have addressed the problem of forcing the first character of a string to be uppercase, but the problem as presented is more difficult. I don't have a solution, but I may be able to clarify the problem.   We do not wish to force the first character to be uppercase. We wish t

Re: change char, keep case

2005-06-19 Thread Ing. Branislav Gerzo
John W. Krahn [JWK], on Saturday, June 18, 2005 at 12:11 (-0700) typed: JWK> $ perl -le' JWK> my $first = 'B'; JWK> my $second = 'a'; JWK> ( $first, $second ) = map lc eq $_ ? uc : lc, ( $second , $first ); JWK> print for $first, $second; JWK> ' JWK> A JWK> b thanks John, nice solution, but if

Re: change char, keep case

2005-06-18 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Elvis Cehajic [EC], on Saturday, June 18, 2005 at 19:11 (+0200) wrote: EC> Like that?: EC> use strict; EC> use warnings; EC> my $first = 'B'; EC> my $second = 'a'; EC> ($first, $second) = (uc($second) , lc($first)); EC> print $first, "\n"; EC> print $second, "\n";

Re: change char, keep case

2005-06-18 Thread Elvis Cehajic
Ing. Branislav Gerzo schrieb: Elvis Cehajic [EC], on Saturday, June 18, 2005 at 19:11 (+0200) wrote: EC> Like that?: EC> use strict; EC> use warnings; EC> my $first = 'B'; EC> my $second = 'a'; EC> ($first, $second) = (uc($second) , lc($first)); EC> print $first, "\n"; EC> print $second, "

Re: change char, keep case

2005-06-18 Thread Ing. Branislav Gerzo
Elvis Cehajic [EC], on Saturday, June 18, 2005 at 19:11 (+0200) wrote: EC> Like that?: EC> use strict; EC> use warnings; EC> my $first = 'B'; EC> my $second = 'a'; EC> ($first, $second) = (uc($second) , lc($first)); EC> print $first, "\n"; EC> print $second, "\n"; sorry, I was not clear. I d

Re: change char, keep case

2005-06-18 Thread Elvis Cehajic
Ing. Branislav Gerzo schrieb: Hi all, quite interesting, how you would write this without $temp: use strict; use warnings; my $first = 'B'; my $second = 'a'; ($first, $second) = ($second , $first); print $first, "\n"; print $second, "\n"; but I want keep case of chars, so output is: "Ab" H

RE: change char, keep case

2005-06-18 Thread Moon, John
Sent: Saturday, June 18, 2005 12:58 PM To: beginners@perl.org Subject: change char, keep case Hi all, quite interesting, how you would write this without $temp: use strict; use warnings; my $first = 'B'; my $second = 'a'; ($first, $second) = ($second , $first); print

change char, keep case

2005-06-18 Thread Ing. Branislav Gerzo
Hi all, quite interesting, how you would write this without $temp: use strict; use warnings; my $first = 'B'; my $second = 'a'; ($first, $second) = ($second , $first); print $first, "\n"; print $second, "\n"; but I want keep case of chars, so output is: "Ab" Have a nice day :) -- To unsub