I want to be able to generate a string that contains letters and numbers in Raku. I can't find a module that works.
I want to be able to generate something like this: w6sj7d2j2
say ("a".."z","A".."Z",0..9).flat.roll(8).join; # M9lldSFC
("a".."z","A".."Z",0..9)
specifies the list of characters that you want to occur in your random string.
.flat
makes sure the ranges will be flattened to their elements
.roll(8)
selects a random element from the list 8 times.
.join
concatenates the selected elements from the list into a single string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With