We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Integer.parse/1
1 parent f2e6d6a commit 2ab126eCopy full SHA for 2ab126e
1 file changed
lib/elixir/lib/integer.ex
@@ -270,7 +270,7 @@ defmodule Integer do
270
An optional `base` to the corresponding integer can be provided.
271
If `base` is not given, 10 will be used.
272
273
- If successful, returns a tuple in the form of `{integer, remainder_of_binary}`.
+ If successful, returns a tuple in the form of `{integer, remaining_string}`.
274
Otherwise `:error`.
275
276
Raises an error if `base` is less than 2 or more than 36.
@@ -289,6 +289,9 @@ defmodule Integer do
289
iex> Integer.parse("three")
290
:error
291
292
+ iex> Integer.parse("404 not found")
293
+ {404, " not found"}
294
+
295
iex> Integer.parse("34", 10)
296
{34, ""}
297
0 commit comments