I need to remove all slashed at the end of url,and i don't known how many slashes at the end.
String.replaceAll ("\\/$", "");
$ means that it is at the end of the String
As per @WiktorStribiżew to remove multiple slashes
String.replaceAll ("/+$", "");