How to replace a back slash with another character in Java?
<p>I'm trying the following code in Java in which I need to replace a back slash with a forward slash but I can't.</p>

<pre><code>package superpkg;
import java.util.regex.Matcher;

final public class Super
{
    public static void main(String[] args) 
    {
         String string="xxx\\aaa";

         string.replaceAll("\\\\", "/");
         System.out.println(string);

         string.replaceAll(Matcher.quoteReplacement("\\"), "/");
         System.out.println(string);
    }
}
</code></pre>

<hr>

<p>In both the cases, it displays the following output.</p>

<pre><code>xxx\aaa
xxx\aaa
</code></pre>

<p>means that the back slash in the given string is not replaced with the forward slash as expected. How can it be achieved?</p>
