Remove string after last occurrence of character "/" - Android (JAVA)
<p>In my application, I am appending string to create path to generate URL. Now I want to remove that appended string on pressing back button.</p>

<p>Suppose this is the string : </p>

<pre><code>/String1/String2/String3/String4/String5
</code></pre>

<p>Now I want a string like this: </p>

<pre><code>/String1/String2/String3/String4/
</code></pre>

<p>How can I do this??</p>

<p>Please help me.</p>

<p>Thanks</p>
