public class Bla { public static void main(String[] args) { String s = "/sdsaads/gtagrf/eredsa"; System.out.println(s.replace("a$", "")); } } I want to erase the "a" in the end of the string. When I delete the $, all the "a" disappears, but when I put it, nothing occurs. Explanation ?