In Allomorph§
See primary documentation in context for method samemark
method samemark(Allomorph: |c)
Calls Str.samemark
on the invocant's Str
value.
In Str§
See primary documentation in context for routine samemark
multi 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('Räku', 'a'); # OUTPUT: «Raku»say samemark('aöä', ''); # OUTPUT: «aöä»