What is the Java equivalent of Trim('/') in C# : <p>Consider this code:</p>

<pre><code>string xx = "/test/file2/".Trim('/');
Console.WriteLine(xx);
Console.Read();
</code></pre>

<p>This code returns <code>test/file2</code>. What is an efficient way to do this in Java?</p>
