Introducing the translation operator : translation « Regular Expression « Perl






Introducing the translation operator

    

#!usr/bin/perl


use warnings;
use strict;

my $string = "this is a test";
$_ = "hello, abc";

print "$string\n";
print "$_\n\n";

$string =~ tr/a-z/0123456789.,';)(*&^%#@!/;
tr/a-z/0123456789.,';)(*&^%#@!/;

print "$string\n";
print "$_\n";

   
    
    
    
  








Related examples in the same category

1.Options for the translation operator.
2.Swap the first two words in a string
3.Occurences of planet were changed to world