title: Remove a trailing slash from a string(changed from url type) in JAVA
body: <p>I want to remove the trailing slash from a string in Java. </p>
  
  <p>I want to check if the string ends with a url, and if it does, i want to remove it.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>String s = "http://almaden.ibm.com/";
  
  s= s.replaceAll("/","");
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>String s = "http://almaden.ibm.com/";
  length  =  s.length();
  --length;
  Char buff = s.charAt((length);
  if(buff == '/')
  {
       LOGGER.info("ends with trailing slash");
  /*how to remove?*/
  }
  else  LOGGER.info("Doesnt end with trailing slash");
  </code></pre>
  
  <p>But neither work.</p>