質問編集履歴
1
正規表現が正しくなかったので修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
const str = "apple,banana,orange";
|
8
8
|
|
9
|
-
const replaced = str.replace(/,/, ' ')
|
9
|
+
const replaced = str.replace(/,/g, ' ')
|
10
10
|
|
11
11
|
console.log(replaced) // apple banana orange
|
12
12
|
|