Help for this page

Select Code to Download


  1. or download this
    if ($string =~ m!(^[A-Za-z0-9]{4})$!) {
        $string =~ tr/[a-z]/[A-Z]/;
    ...
    } else  {
        # do some error
    }
    
  2. or download this
    Benchmark: timing 1000000 iterations of tr, uc...
            tr: 10 secs ( 7.49 usr  0.00 sys =  7.49 cpu)
            uc:  9 secs ( 6.60 usr  0.00 sys =  6.60 cpu)