On 9/1/22 23:50, ToddAndMargo via perl6-users wrote:
On 9/1/22 19:37, ToddAndMargo via perl6-users wrote:
Hi All,
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.
-T
$ raku -e 'p
On 9/1/22 19:37, ToddAndMargo via perl6-users wrote:
Hi All,
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.
-T
$ raku -e 'printf "%.4s\n", "andefghi";'
ande
Thank you all!
-T
Hi Todd,
~$ raku -e '(sprintf "%.4s", "andefghi" ).put;'
ande
~$ raku -e 'put (sprintf "%.4s", "andefghi" );'
ande
If sprintf isn't a requirement, then:
~$ raku -e 'put substr("andefghi", 0..3);'
ande
HTH, Bill.
On Thu, Sep 1, 2022 at 7:37 PM ToddAndMargo via perl6-users <
perl6-us...@perl.or
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
signature.as
On Fri, 2 Sept 2022 at 12:37, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> 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.
>
$ raku -e 'printf "%.4s\n","andef
Hi All,
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.
-T