Skip to content

Commit 173611c

Browse files
authored
fixed typo
1 parent 7f65d8b commit 173611c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/stdlib/regexp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ str.replace(search, replacement)
298298
'aaa'.replace(/a/g, 'b') // "bbb"
299299
```
300300

301-
上面代码中,最后一个正则表达式使用了`g`修饰符,导致所有的`b`都被替换掉了。
301+
上面代码中,最后一个正则表达式使用了`g`修饰符,导致所有的`a`都被替换掉了。
302302

303303
`replace`方法的一个应用,就是消除字符串首尾两端的空格。
304304

0 commit comments

Comments
 (0)