Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c26890b

Browse files
authored
Merge pull request wangdoc#159 from atimidguy/patch-1
fixed typo
2 parents 7f65d8b + 173611c commit c26890b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)

AltStyle によって変換されたページ (->オリジナル) /