title: How to replace one or more \ in string with just \?
body: <p>Consider the string,</p>
  
  <pre><code>this\is\\a\new\\string
  </code></pre>
  
  <p>The output should be:</p>
  
  <pre><code>this\is\a\new\string
  </code></pre>
  
  <p>So basically one or more <code>\</code> character should be replaced with just one <code>\</code>.
  I tried the following: </p>
  
  <pre><code>str = str.replace("[\\]+","\")
  </code></pre>
  
  <p>but it was no use. The reason I used two <code>\</code> in <code>[\\]+</code> was because internally <code>\</code> is stored as <code>\\</code>.  I know this might be a basic regex question, but I am able to replace one or more normal alphabets but not <code>\</code> character. Any help is really appreciated.</p>