title: how to replace \ with / using java script string functions
body: <p>I have image path like this</p>
  <pre><code>var str = &quot;D:\Poc\testProject\DataPush\public\unzip\cust\AccountData\2.jpg&quot;
  </code></pre>
  <p>this string throw error shown in image. but when i remove unzip with extract it's work fine don't know why??
  <a href="https://i.stack.imgur.com/cg1uH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cg1uH.png" alt="enter image description here" /></a></p>
  <p>but when i do it's work fine but new issue start</p>
  <pre><code>var str = &quot;D:\Poc\testProject\DataPush\public\extract\cust\AccountData\2.jpg&quot;
  </code></pre>
  <p>when i use <code>replace</code> function of java script it's show result of below image.</p>
  <p><a href="https://i.stack.imgur.com/18jPs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/18jPs.png" alt="enter image description here" /></a></p>
  <p>basically i want output like this from above string.</p>
  <pre><code>D:/Poc/testProject/DataPush/public/extract/cust/AccountData/2.jpg
  </code></pre>
  <p>As suggested in remove testProject output is same for <code>str.replace('/\/g','/')</code></p>
  <pre><code>var str = D:\Poc\DataPush\public\extract\cust\AccountData\2.jpg
  </code></pre>
  <p>output is</p>
  <pre><code>str.replace('/\\/g','/')
  &quot;D:PocDataPushpublicextractcustAccountData.jpg&quot;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cu0fZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cu0fZ.png" alt="enter image description here" /></a></p>