Help for this page

Select Code to Download


  1. or download this
    my $string = '5424123412345678';
    substr$_,0,-4,'*'x(length()-4)for$string;  # 41
    print $string;
    
  2. or download this
    my $string = '5424123412345678';
    s/(?!.{0,4}$)./*/g for$string;  # 30
    print $string;
    
  3. or download this
    my $string = '5424123412345678';
    $string=~s/(?!.{0,4}$)./*/g;  # 28
    print $string;