Well it looks like you're calling replaceAll correctly.
So you must be doing something else wrong.
Are you putting the string back.
You may need to provide more information or show us the rest of your code.
chartString = chartString.replaceAll("/charts_cache","charts_cache");
Greetings.
Eric