Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added documentation for samecase. [Coke]++ for reviewing.
  • Loading branch information
Jan-Olof Hendig committed Apr 18, 2016
1 parent 46f8d06 commit f3e8184
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/Type/Cool.pod
Expand Up @@ -1009,6 +1009,29 @@ With a customer filter too:
say "have fun working on perl".wordcase(:filter(&uc), :where({ .chars > 3 }));
# HAVE fun WORKING on PERL
=head2 routine samecase
Defined as:
sub samecase(Cool $string, Cool $pattern)
method samecase(Cool:D: Cool $pattern)
Usage:
samecase STRING, PATTERN
STRING.samecase(PATTERN)
Coerces the invocant (or in sub form, the first argument) to L<Str|/type/Str>, and returns a
copy of C<$string> with case information for each individual character changed according to C<$pattern>.
(The pattern string can contain three types of characters, i.e. uppercase, lowercase and caseless.
For a given character in C<$pattern> its case information determines the case of the corresponding
character in the result.)
If C<$string> is longer than C<$pattern>, the case information from the last character of
C<$pattern> is applied to the remaining characters of C<$string>.
say "perL 6".samecase("A__a__"); # Perl 6
say "pERL 6".samecase("Ab"); # Perl 6
=head2 routine uniname
Defined as:
Expand Down

0 comments on commit f3e8184

Please sign in to comment.