File tree Expand file tree Collapse file tree 2 files changed +23
-12
lines changed Expand file tree Collapse file tree 2 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -972,18 +972,10 @@ Defined as:
972
972
sub samecase(Cool $string, Cool $pattern)
973
973
method samecase(Cool:D: Cool $pattern)
974
974
975
- Coerces the invocant (or in sub form, the first argument) to L < Str|/type/Str > ,
976
- and returns a copy of C < $string > with case information for each individual
977
- character changed according to C < $pattern > .
978
-
979
- B < Note > : The pattern string can contain
980
- three types of characters, i.e. uppercase, lowercase and caseless. For a given
981
- character in C < $pattern > its case information determines the case of the
982
- corresponding character in the result.
983
-
984
- If C < $string > is longer than
985
- C < $pattern > , the case information from the last character of C < $pattern > is
986
- applied to the remaining characters of C < $string > .
975
+ Coerces the invocant (or in sub form, the
976
+ first argument) to L < Str|/type/Str > , and calls
977
+ L « C < Str.samecase > |/type/Str#method_samecase» on it.
978
+
987
979
988
980
say "raKu".samecase("A_a_"); # OUTPUT: «Raku»
989
981
say "rAKU".samecase("Ab"); # OUTPUT: «Raku»
Original file line number Diff line number Diff line change @@ -506,6 +506,25 @@ convert those:
506
506
I < Note: > before being standardized in 2017.12, this routine was known
507
507
under its working name of L < parse-names|/routine/parse-names > . This denomination will be removed in the 6.e version.
508
508
509
+ = head2 method samecase
510
+
511
+ multi method samecase(Str:D: Str:D $pattern --> Str:D)
512
+
513
+ Returns a copy of the invocant with case information for each individual
514
+ character changed according to C < $pattern > .
515
+
516
+ B < Note > : The pattern string can contain three types of characters,
517
+ i.e. uppercase, lowercase and caseless. For a given character in
518
+ C < $pattern > its case information determines the case of the corresponding
519
+ character in the result.
520
+
521
+ If the invocant is longer than C < $pattern > , the case information from
522
+ the last character of C < $pattern > is applied to the remaining characters
523
+ of the invocant.
524
+
525
+ say "raKu".samecase("A_a_"); # OUTPUT: «Raku»
526
+ say "rAKU".samecase("Ab"); # OUTPUT: «Raku»
527
+
509
528
= head2 routine split
510
529
511
530
= for code :method
You can’t perform that action at this time.
0 commit comments