routine samemark
1 | class Str |
1.1 | (Str) routine samemark |
Documentation for routine samemark
assembled from the following types:
class Str
From Str
(Str) routine samemark
multi sub samemark(Str , Str --> Str)method samemark(Str: Str --> Str)
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('Pêrl', 'a'); # OUTPUT: «Perl»say samemark('aöä', ''); # OUTPUT: «aöä»