Skip to content

Commit

Permalink
Added docs for Str.samemark. perlpilot++
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Olof Hendig committed Jul 13, 2016
1 parent 5ccce6c commit 4445eef
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/Type/Str.pod6
Expand Up @@ -722,6 +722,25 @@ specified via the C<.from> and C<.to> methods on the C<Match> object, C<$0>.
It is thus not necessary to count characters in order to replace a
substring, hence making the code more flexible.
=head2 routine samemark
multi sub samemark(Str:D $string, Str:D $pattern) returns Str:D
method samemark(Str:D: Str:D $pattern) returns Str:D
Returns a copy of C<$string> with the mark/accent information for each
character changed such that it matches the mark/accent of the corresponding
character in C<$pattern>. If C<$string> is longer than C<$pattern>, the
remaining characters in C<$string> receive the same mark/accent as the last
character in C<$pattern>. This means that C<$pattern> must contain at least
one character or an exception will be thrown.
Examples:
say 'åäö'.samemark('aäo'); # aäo
say 'åäö'.samemark('a'); # aao
say samemark('Pêrl', 'a'); # Perl
=head2 method succ
method succ(Str:D) returns Str:D
Expand Down

0 comments on commit 4445eef

Please sign in to comment.