# Inserting in a string

**URL:** <https://forum.elixirforum.com/t/inserting-in-a-string/3511>\
**Category:** Questions\
**Created:** [February 2, 2017, 7:09pm UTC](https://forum.elixirforum.com/t/inserting-in-a-string/3511 "2017-02-02T19:09:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [February 2, 2017, 7:17pm UTC](https://forum.elixirforum.com/t/inserting-in-a-string/3511/2 "2017-02-02T19:17:05Z")

</div>

I’m unsure why converting from binary to char\_list then back again for each character, but why not just regex?

```elixir
iex> Regex.replace(~r/[A-Z]/, "HelloWorld", " \\0")
" Hello World"

```

Or are you trying to reduce it for some other reason?

> [@Fernando](#):
>
> but instead im getting this =\> “7210110810811187111114108100”

For note, this happens because you are converting it to a charlist, meaning a character is an integer, which you convert an integer back to a binary with your `to_string` call, which gives you the number, not the character.

---

_[View the full topic](https://forum.elixirforum.com/t/inserting-in-a-string/3511)._
