Skip to content

Commit 5a63611

Browse files
author
Jan-Olof Hendig
committed
Added docs for List.fmt
1 parent b633fa9 commit 5a63611

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/Type/List.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,20 @@ Throws an exception if an element can not be coerced into Numeric.
10121012
say (1, "0xff").sum; # 256
10131013
say sum(0b1111, 5); # 20
10141014
1015+
=head2 method fmt
1016+
1017+
Defined as:
1018+
1019+
method fmt($format = '%s', $separator = ' ') returns Str:D
1020+
1021+
Returns a string where each element in the list has been formatted according
1022+
to C<$format> and where each element is separated by C<$separator>.
1023+
1024+
For more information about formats strings, see L<sprintf|/routine/sprintf>.
1025+
1026+
my @a = 8..11;
1027+
say @a.fmt('%03d', ','); # 008,009,010,011
1028+
10151029
=end pod
10161030

10171031
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)