# Convert a string to an integer?

**URL:** <https://forum.elixirforum.com/t/convert-a-string-to-an-integer/4784>\
**Category:** Questions\
**Tags:** how-to-question\
**Created:** [April 25, 2017, 9:35pm UTC](https://forum.elixirforum.com/t/convert-a-string-to-an-integer/4784 "2017-04-25T21:35:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![benwilson512](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/32/1457_2.png) [@benwilson512](https://forum.elixirforum.com/u/benwilson512)\
**Post date:** [April 25, 2017, 10:16pm UTC](https://forum.elixirforum.com/t/convert-a-string-to-an-integer/4784/4 "2017-04-25T22:16:58Z")

</div>

Edited for code blocks. I recommend formatting code that you post, it helps others understand what’s going on to help you better.

In your case you wrote `:string.to_integer` but @tyro wrote `String.to_integer`. Elixir module names capitalized, erlang modules tend to be lower case. That’s why `:rand.uniform` uses lower case `:rand`, it’s an erlang module. `String` however is an Elixir module, you can find the documentation on it here: [String — Elixir v1.20.2](https://hexdocs.pm/elixir/String.html)

---

_[View the full topic](https://forum.elixirforum.com/t/convert-a-string-to-an-integer/4784)._
