In my application, I am appending a string to create path to generate a URL. Now I want to remove that appended string on pressing back button.
Suppose this is the s
The third line in Nepster's answer should be
String x =path.substring(pos+1 , path.length());
and not String x =path.substring(pos+1 , path.length()-1); since substring() method takes the end+1 offset as the second parameter.
String x =path.substring(pos+1 , path.length()-1);
substring()