Quick actions

cmd+k|ctrl+k

Navigation

Languages

Code Golf: Multiply a string by a number

Snippet info

Language

Raku

Visibility

public

Author

markjreed

Created

2023-01-07T04:05:12.743203Z

Updated

2023-01-07T04:07:23.725908Z

sub infix:<⍟>{($^a.comb »x»$^b).join}
for [('Hello World!', 3), 
     ('foo', 12),
     ('String', -3),
     ('This is a fun challenge', 0),
     ('World!', 2)] -> ($s, $n) {
    say "'$s' ⍟ $n == '{$s ⍟ $n}'"
}
INFO