Is there a way to replace a string in a text without spaces? : <p>Is there a way to replace something like this:</p>

<pre><code>testHoraciotestHellotest
</code></pre>

<p>And replace the 'test' word via javascript, I've tried with the <code>.replace()</code> function but it didn't work</p>
