Last active
July 13, 2016 15:56
-
-
Save dogbert17/3224c4290a01b94a023e03175dfafabe to your computer and use it in GitHub Desktop.
Attempt to document Str.samemark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment