Skip to content

Commit 2ab126e

Browse files
authored
Add another example to Integer.parse/1 (#15101)
1 parent f2e6d6a commit 2ab126e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/elixir/lib/integer.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ defmodule Integer do
270270
An optional `base` to the corresponding integer can be provided.
271271
If `base` is not given, 10 will be used.
272272
273-
If successful, returns a tuple in the form of `{integer, remainder_of_binary}`.
273+
If successful, returns a tuple in the form of `{integer, remaining_string}`.
274274
Otherwise `:error`.
275275
276276
Raises an error if `base` is less than 2 or more than 36.
@@ -289,6 +289,9 @@ defmodule Integer do
289289
iex> Integer.parse("three")
290290
:error
291291
292+
iex> Integer.parse("404 not found")
293+
{404, " not found"}
294+
292295
iex> Integer.parse("34", 10)
293296
{34, ""}
294297

0 commit comments

Comments
 (0)