Skip to content

Commit

Permalink
Remove references to Str.sprintf
Browse files Browse the repository at this point in the history
While here minor rewriting of {s,}printf's descriptions, including the
acknowledgment that this document's sprintf section holds the reference
to printf format description :-)
  • Loading branch information
stoned authored and JJ committed Jan 9, 2021
1 parent d6ffb79 commit 2c82005
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions doc/Type/independent-routines.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,11 @@ Defined as:
method printf (*@args)
multi sub printf(Cool:D $format, *@args)
As a method, takes the object as a format using
L<the same language as C<Str.sprintf>|/routine/sprintf>; as a sub, its
first argument will be
the format string, and the rest of the arguments will be substituted in the
format following the format conventions.
Produces output according to a format. The format used is the invocant
(if called in method form) or the first argument (if called as a routine).
The rest of the arguments will be substituted in the format following
the format conventions. See L<sprintf|/routine/sprintf> for details on
acceptable format directives.
"%s is %s".printf("þor", "mighty"); # OUTPUT: «þor is mighty»
printf( "%s is %s", "þor", "mighty"); # OUTPUT: «þor is mighty»
Expand All @@ -658,10 +658,9 @@ Defined as:
method sprintf(*@args)
multi sub sprintf(Cool:D $format, *@args)
Formats and returns a string, following
L<the same language as C<Str.sprintf>|/routine/sprintf>, using as such
format either the object (if called in method form) or the first argument (if
called as a routine)
Returns a string according to a format as described below. The format
used is the invocant (if called in method form) or the first argument
(if called as a routine).
sprintf( "%s the %d%s", "þor", 1, "st").put; # OUTPUT: «þor the 1st␤»
sprintf( "%s is %s", "þor", "mighty").put; # OUTPUT: «þor is mighty␤»
Expand Down

0 comments on commit 2c82005

Please sign in to comment.