File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1009,6 +1009,29 @@ With a customer filter too:
1009
1009
say "have fun working on perl".wordcase(:filter(&uc), :where({ .chars > 3 }));
1010
1010
# HAVE fun WORKING on PERL
1011
1011
1012
+ = head2 routine samecase
1013
+
1014
+ Defined as:
1015
+
1016
+ sub samecase(Cool $string, Cool $pattern)
1017
+ method samecase(Cool:D: Cool $pattern)
1018
+
1019
+ Usage:
1020
+
1021
+ samecase STRING, PATTERN
1022
+ STRING.samecase(PATTERN)
1023
+
1024
+ Coerces the invocant (or in sub form, the first argument) to L < Str|/type/Str > , and returns a
1025
+ copy of C < $string > with case information for each individual character changed according to C < $pattern > .
1026
+ (The pattern string can contain three types of characters, i.e. uppercase, lowercase and caseless.
1027
+ For a given character in C < $pattern > its case information determines the case of the corresponding
1028
+ character in the result.)
1029
+ If C < $string > is longer than C < $pattern > , the case information from the last character of
1030
+ C < $pattern > is applied to the remaining characters of C < $string > .
1031
+
1032
+ say "perL 6".samecase("A__a__"); # Perl 6
1033
+ say "pERL 6".samecase("Ab"); # Perl 6
1034
+
1012
1035
= head2 routine uniname
1013
1036
1014
1037
Defined as:
You can’t perform that action at this time.
0 commit comments