ToddAndMargo via perl6-users @ 2022-09-01 19:37 -07:

> Is there a cleaner way to do this?
>
>     $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'
>     ande
>
> I want to print the first four letter s to STDOUT.

You can use substr,

  | put "andefghi".substr(0, 4)
  ande

Attachment: signature.asc
Description: PGP signature

Reply via email to