The confusion lies in that replace only replaces the first occurrence of a substring, not all occurrences. For example:
To replace all instances of a substring, you’ve needed to use a regular expression:
Using regular expressions is certainly powerful but let’s be honest — oftentimes we simply want to replace all instances of a simple substring that shouldn’t require a regular expression.
Sometimes an API exists in a confusing format and standards bodies simply need to improve the situation. I’m glad they did so with replaceAll!