title: How would I format a file location?
body: <p>I have the variable <code>directory</code> which will be a directory that the user inputs, 
  such as 
  "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe". The issue is that the program doesn't recognize the directory, and thus won't launch it via <code>Runtime.getRuntime().exec(new String[] {directory});</code></p>
  
  <p>How would I make a method/algorithm that takes every <code>\</code> from <code>directory</code> and turns it into a <code>\\</code>?</p>
  
  <pre><code>if (directory.substring(j, j+1).equals("\\"))
  {
      //directory.substring(j, j+1) == "\\\\";
  } 
  </code></pre>
  
  <p>Ex:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  </code></pre>
  
  <p>should turn into</p>
  
  <pre class="lang-none prettyprint-override"><code>C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe
  </code></pre>