On Wed, 2003-07-16 at 00:19, Geoff Thurman wrote:
> In perl, how about
> 
> $_ = "Can'T eat shan'T eat Jane'S cooking.";
> s/'T /'t /g;
> s/'S /'s /g;
> print $_;
> 
> Assuming it's only T and S.

Yes, or if you have an array of strings, and want to replace all capital
letters in all strings, maybe this could be a solution:

sub toLower
{
  my @parms = @_;
  for (@parms) { tr/A-Z/a-Z/ }
  return wantarray ? @parms : $parms[0];
}

@result = toLower(@array);

Also works when just passing one string:

$result = toLower($string);

/Tomas


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to