Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Checks that samecase is actually included, deletes from TODO. refs #2277
  • Loading branch information
JJ committed Sep 27, 2018
1 parent cf116bb commit e527812
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions doc/Type/Cool.pod6
Expand Up @@ -7,7 +7,7 @@
class Cool is Any { }
C<Cool>, also known as the B<C>onvenient B<OO> B<L>oop, is a base class
employed by a number of built-in classes that can be meaningfully
employed by a number of built-in classes whose instances can be meaningfully
coerced to a string and a number. For example, an L<Array> can be used
in mathematical operations, where its numerical representation is the
number of elements it contains. At the same time, it can be concatenated
Expand Down Expand Up @@ -917,13 +917,18 @@ Defined as:
sub samecase(Cool $string, Cool $pattern)
method samecase(Cool:D: Cool $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>.
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>.
B<Note>: 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__"); # OUTPUT: «Perl 6␤»
say "pERL 6".samecase("Ab"); # OUTPUT: «Perl 6␤»
Expand Down Expand Up @@ -1475,12 +1480,13 @@ the case it's being used as a C<sub>
say 1.unpolar(⅓*pi);
# OUTPUT: «0.5000000000000001+0.8660254037844386i␤»
=begin comment
TODO:
sprintf, printf, samecase
sprintf, printf
=end comment
Expand Down

0 comments on commit e527812

Please sign in to comment.