Mix string multiplication operator and number multiplication : Repetition « String « Perl






Mix string multiplication operator and number multiplication

    

#!/usr/bin/perl -w

print "Ba" . "na" x 4*3 ,"\n";
print "Ba" . "na" x (4*3) ,"\n";

   
    
    
    
  








Related examples in the same category

1.Repetition operator, marked with an x.
2.Repetition; print 10 stars
3.brackets and Repetition operator
4.Use Repetition operator in conjunction with concatenation.
5.String multiply operator
6.If you want to draw a horizontal line made up of hyphens:
7.x times pattern : Repeat a string x times