title: Convert Module name to String and back to module
body: <p>If we have a module name like this:</p>
  
  <pre><code> Module.V1.CountryTest
  </code></pre>
  
  <p>I can convert it to String like this:</p>
  
  <pre><code>   Module.V1.CountryTest |&gt; to_string
  </code></pre>
  
  <p>Now there are some interesting results I am getting on <code>iex</code></p>
  
  <pre><code>   module = Module.V1.CountryTest |&gt; to_string
           "Elixir.Module.V1.CountryTest"
     iex(2)&gt; replace = Regex.replace(~r/Test/, module, "")
          "Elixir.Module.V1.Country"
     iex(3)&gt; replace |&gt; String.to_atom
           Module.V1.Country
  </code></pre>
  
  <p>So if I remove <code>Test</code>. And convert it back to <code>atom</code>. It will give me back the module name. But If I <code>replace</code> or <code>remove</code> anything else from the module name it gives me this output:</p>
  
  <pre><code>   some = Regex.replace(~r/Country/, replace, "")
       "Elixir.Module.V1."
     iex(5)&gt; some |&gt; String.to_atom
       :"Elixir.Module.V1."
  </code></pre>
  
  <p>Can anybody please explain this behavior? And why it wont allow any other parts to change or replace. Meaning giving me back the output like this  </p>
  
  <pre><code> Module.V1.Country
  </code></pre>
  
  <p>I mean if its possible.</p>
  
  <p>Thanks.</p>