title: Normalizing slashes from a string path in java
body: <pre><code>String path = "/var/lib/////xen//images///rhel";
  </code></pre>
  
  <p>the number of slashes can be of any number. How to normalize the path in java like :</p>
  
  <pre><code>/var/lib/xen/images/rhel
  </code></pre>