Deprecate replaceAll #70

Closed
opened 2019-11-11 20:53:03 +01:00 by FWDekker · 0 comments
Owner

The replaceAll function was used to replace all occurrences of a substring in a string, but this should be replaced by a simple replace using a regex wherever possible.

The difference is that "aaa".replaceAll(/aa/, "a") equals "a" whereas "aaa".replace(/aa/, "a") equals"aa", which may be a more natural interpretation in some cases.

The `replaceAll` function was used to replace all occurrences of a substring in a string, but this should be replaced by a simple `replace` using a regex wherever possible. The difference is that `"aaa".replaceAll(/aa/, "a")` equals `"a"` whereas `"aaa".replace(/aa/, "a")` equals`"aa"`, which may be a more natural interpretation in some cases.
FWDekker self-assigned this 2019-11-11 20:53:03 +01:00
FWDekker added the
code-quality
label 2019-11-11 20:53:03 +01:00
Sign in to join this conversation.
No description provided.