title: Trim characters in Java
body: <p>How can I trim characters in Java?<br>
  e.g. </p>
  
  <pre><code>String j = “\joe\jill\”.Trim(new char[] {“\”});
  </code></pre>
  
  <p><em>j</em> should be </p>
  
  <blockquote>
    <p>"joe\jill"</p>
  </blockquote>
  
  <pre><code>String j = “jack\joe\jill\”.Trim("jack");
  </code></pre>
  
  <p><em>j</em> should be </p>
  
  <blockquote>
    <p>"\joe\jill\"</p>
  </blockquote>
  
  <p>etc</p>