Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

document Buf.subbuf

  • Loading branch information...
commit abefe1a5d3fecc15001e60ab029fcdd9d30a73ed 1 parent 4fd9dad
@moritz moritz authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/Buf.pod
View
10 lib/Buf.pod
@@ -37,4 +37,14 @@ Returns the number of elements of the buffer.
Applies an encoding to turn the buffer into a C<Str>.
+=head2 subbuf
+
+ method subbuf(Int $from, Int $len = self.elems) returns Buf:D
+
+Extracts a part of the invocant buffer, statrting from the index with
+elements C<$from>, and taking C<$len> elements (or less if the buffer is
+shorter), and creates a new buffer as the result.
+
+ say Buf.new(1..10).subbuf(2, 4); # Buf:0x<03 04 05 06>
+
=end pod
Please sign in to comment.
Something went wrong with that request. Please try again.