Documentation for routine samemark assembled from the following pages:

Class: Allomorph §

From Allomorph

(Allomorph) method samemark §

method samemark(Allomorph:D: |c)

Calls Str.samemark on the invocant's Str value.

Class: Str §

From Str

(Str) routine samemark §

multi sub samemark(Str:D $stringStr:D $pattern --> Str:D)
method    samemark(Str:D: Str:D $pattern --> Str:D)

Returns a copy of $string with the mark/accent information for each character changed such that it matches the mark/accent of the corresponding character in $pattern. If $string is longer than $pattern, the remaining characters in $string receive the same mark/accent as the last character in $pattern. If $pattern is empty no changes will be made.

Examples:

say 'åäö'.samemark('aäo');                        # OUTPUT: «aäo␤» 
say 'åäö'.samemark('a');                          # OUTPUT: «aao␤» 
 
say samemark('Räku''a');                        # OUTPUT: «Raku␤» 
say samemark('aöä''');                          # OUTPUT: «aöä␤»