tr

see codes below

my $str = 'abc';
my $count = ( $str =~ tr/a-z/A-Z/ );
print $count, "\n"; # How many chars were traslate: 3
print $str, "\n";   # The traslated string: ABC

==

posted on 2012-04-26 10:47  perlman  阅读(205)  评论(0编辑  收藏  举报

导航