Skip to content

Commit e170c16

Browse files
authored
Fixed wrong example
Such an obvious mistake.
1 parent c6b5104 commit e170c16

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

doc/Type/Str.pod6

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ for repeated operations:
10071007
10081008
my $string = "A character in the 'Flintstones' is: barney";
10091009
$string ~~ /(barney)/;
1010-
my $ref := substr-rw($string, $0.from, $0.to);
1010+
my $ref := substr-rw($string, $0.from, $0.to-$0.from);
10111011
$string.say;
10121012
# OUTPUT: «A character in the 'Flintstones' is: barney␤»
10131013
$ref = "fred";
@@ -1017,11 +1017,6 @@ for repeated operations:
10171017
$string.say;
10181018
# OUTPUT: «A character in the 'Flintstones' is: wilma␤»
10191019
1020-
Notice that the start position and length of string to replace has been
1021-
specified via the C<.from> and C<.to> methods on the C<Match> object, C<$0>.
1022-
It is thus not necessary to count characters in order to replace a
1023-
substring, hence making the code more flexible.
1024-
10251020
=head2 routine samemark
10261021
10271022
multi sub samemark(Str:D $string, Str:D $pattern --> Str:D)

0 commit comments

Comments
 (0)