Skip to content

Commit 137a43b

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] sonarqube: Prefer String#replaceAll() over String#replace().
Strings should use "replaceAll()" instead of "replace()" with global regex typescript:S7781
1 parent 61e6036 commit 137a43b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/projecteuler/problem0017.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function problem0017(init: number, last: number): number {
1212

1313
for (let i = init; i <= last; i++) {
1414
word = numberToWord(i);
15-
replaced = word.replace(/[^a-z0-9]/gi, '');
15+
replaced = word.replaceAll(/[^a-z0-9]/gi, '');
1616

1717
acum += replaced.length;
1818

0 commit comments

Comments
 (0)