should help you out replaceAll works with regular expressions. In the replacAll method, $ is a reserved character used to reference groups defined in the regular expression given as first parameter, so you need to escape it.
String nuova2z=nuovaz.replaceAll("s", "\\$");
Matcher.replaceAll() and String.replaceAll() don't seem to work on Galaxy S 6
With these it helps Mistery solved. When using String.charAt() to analize the string, it turns out that the spaces weren't simple spaces after all, but "non breaking spaces" (code 160). Changing the code to remove all whitespace fixed it:
should help you out In the Matcher case, you are doing some extra work that is not necessary, but it still effectively does the same thing (but I would assume you pay an efficiency price, though it would be negligible in this case). In the first case, you do geb.replaceAll("\\.", ""). So you are saying take geb, and replace every period with 'nothing' essentially.