ArgumentError example for binary_part (#10370)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user