Skip to content

Commit 11c89a0

Browse files
authored
Add two more examples to comb
Just to make the "chunking" ability more obvious to newcomers.
1 parent be0e9fb commit 11c89a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/Type/Str.pod6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ If no matcher is supplied, a list of characters in the string
336336
Examples:
337337
338338
say "abc".comb.perl; # OUTPUT: «("a", "b", "c").Seq␤»
339+
say 'abcdefghijk'.comb(3).perl # OUTPUT: «("abc", "def", "ghi", "jk").Seq␤»
340+
say 'abcdefghijk'.comb(3, 2).perl # OUTPUT: «("abc", "def").Seq␤»
339341
say comb(/\w/, "a;b;c").perl; # OUTPUT: «("a", "b", "c").Seq␤»
340342
say comb(/\N/, "a;b;c").perl; # OUTPUT: «("a", ";", "b", ";", "c").Seq␤»
341343
say comb(/\w/, "a;b;c", 2).perl; # OUTPUT: «("a", "b").Seq␤»

0 commit comments

Comments
 (0)