Skip to content

Commit 936f2a8

Browse files
committed
Merge pull request #28 from virtualsue/master
More minor updates
2 parents 29ea342 + 61f427f commit 936f2a8

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

categories/cookbook/01strings/01-01substrings.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
=end pod
1212

13-
my ($string, $offset, $count) = ('Rakudo is da bomb', 2, 5);
13+
my ($string, $offset, $count) = ('Rakudo is da bomb', 2, 7);
1414
say $string.substr($offset, $count);
1515
say $string.substr($offset);
1616

categories/cookbook/01strings/01-04converting-values.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
say $copyright ~ " : " ~ $copyright.ord ~ " : " ~ $copyright.ord.chr;
2020

2121
$char = 'foo';
22-
# ord returns the codepoint of the first char in a string
23-
say $char ~ " : " ~ $char.ord;
22+
# ords returns the codepoints of all char in a string
23+
say $char ~ " : " ~ $char.ords;
2424

2525
# vim: expandtab shiftwidth=4 ft=perl6

categories/cookbook/01strings/01-05namedunicode.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
say "\c[REGISTERED SIGN]";
1212

13-
say uniname("\x1f63E"); # POUTING CAT FACE
13+
# POUTING CAT FACE
14+
"\x1f63E".say;
15+
"\x1f63E".uniname.say;
1416

1517
# vim: expandtab shiftwidth=4 ft=perl6

categories/cookbook/01strings/01-13upper-lower-case.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
77
=AUTHOR stmuk
88
9-
You have a string and what to upper/lower case it
9+
You have a string and want to upper/lower case it
1010
1111
=end pod
1212

1313
my $string = "the cat sat on the mat";
1414

1515
say $string=$string.uc; # THE CAT SAT ON THE MAT
1616

17-
say $string.=lc; # the cat sat on the mat
17+
say $string.=lc; # the cat sat on the mat
1818

19-
say $string.wordcase; # The Cat Sat On The Mat
19+
say $string.wordcase; # The Cat Sat On The Mat
20+
21+
$string.tc.say; # The cat sat on the mat
2022

2123
# vim: expandtab shiftwidth=4 ft=perl6

t/categories/cookbook/01strings.t

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ subtest {
1414
Hello
1515
Hello
1616
Hello
17-
HelloWorld!
17+
Hello World!
18+
Hello World!
1819
Hello World!
1920
This is $string: a scalar holding a String
2021
$string is Str
@@ -58,9 +59,9 @@ subtest {
5859

5960
my $example-name = "01-01substrings.pl";
6061
my $expected-output = q:to/EOD/;
61-
gs is
62-
gs is da bomb
63-
Pugilism ain't for wimps
62+
kudo is
63+
kudo is da bomb
64+
Radiators are nice in winter
6465
EOD
6566

6667
my $output = run-example($example-name);
@@ -85,10 +86,11 @@ subtest {
8586

8687
my $example-name = "01-04converting-values.pl";
8788
my $expected-output = q:to/EOD/;
88-
97
89-
a
90-
102
91-
EOD
89+
97
90+
a
91+
© : 169 : ©
92+
foo : 102 111 111
93+
EOD
9294

9395
my $output = run-example($example-name);
9496
is($output, $expected-output, $example-name);
@@ -100,6 +102,7 @@ subtest {
100102
my $example-name = "01-05namedunicode.pl";
101103
my $expected-output = q:to/EOD/;
102104
®
105+
😾
103106
POUTING CAT FACE
104107
EOD
105108

@@ -128,6 +131,7 @@ subtest {
128131
THE CAT SAT ON THE MAT
129132
the cat sat on the mat
130133
The Cat Sat On The Mat
134+
The cat sat on the mat
131135
EOD
132136

133137
my $output = run-example($example-name);

0 commit comments

Comments
 (0)