ArgumentError example for binary_part (#10370)

This commit is contained in:
Hassan Shaikley
2020-09-27 08:44:07 +02:00
committed by GitHub
parent 62aa2ee33c
commit 538a9a3f41
+5
View File
@@ -305,6 +305,11 @@ defmodule Kernel do
iex> binary_part("Hello", 5, -3)
"llo"
An `ArgumentError` is raised when the length is outside of the binary:
iex> binary_part("Hello", 0, 10)
** (ArgumentError) argument error
"""
@doc guard: true
@spec binary_part(binary, non_neg_integer, integer) :: binary