πŸ“˜ String repetition operator x in Perl 6

x repeats the string the given number of times.

say "A" x 5; # AAAAA

Non-string values will be converted to strings before the operation.

say 0 x 5; # 00000

If the number of repetitions is negative or zero, an empty string is returned.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s