For the confused, ‘easier’ refers to the fact that .replace() is using regular expressions and .substr does not. Both work and in a small document the difference is moot. As/if your document grows, the difference may begin to show as regular expressions (regex) are generally more ‘work’ for the app to perform.