Skip to content

Commit abefe1a

Browse files
committed
document Buf.subbuf
1 parent 4fd9dad commit abefe1a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Buf.pod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,14 @@ Returns the number of elements of the buffer.
3737
3838
Applies an encoding to turn the buffer into a C<Str>.
3939
40+
=head2 subbuf
41+
42+
method subbuf(Int $from, Int $len = self.elems) returns Buf:D
43+
44+
Extracts a part of the invocant buffer, statrting from the index with
45+
elements C<$from>, and taking C<$len> elements (or less if the buffer is
46+
shorter), and creates a new buffer as the result.
47+
48+
say Buf.new(1..10).subbuf(2, 4); # Buf:0x<03 04 05 06>
49+
4050
=end pod

0 commit comments

Comments
 (0)