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 6418344

Browse files
committed
closes #2411
1 parent 701392c commit 6418344

File tree

1 file changed

+2
-2
lines changed
  • 9-regular-expressions/17-regexp-methods

1 file changed

+2
-2
lines changed

‎9-regular-expressions/17-regexp-methods/article.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ Splits the string using the regexp (or a substring) as a delimiter.
9595
We can use `split` with strings, like this:
9696

9797
```js run
98-
alert('12-34-56'.split('-')) // array of [12, 34, 56]
98+
alert('12-34-56'.split('-')) // array of ['12', '34', '56']
9999
```
100100

101101
But we can split by a regular expression, the same way:
102102

103103
```js run
104-
alert('12, 34, 56'.split(/,\s*/)) // array of [12, 34, 56]
104+
alert('12, 34, 56'.split(/,\s*/)) // array of ['12', '34', '56']
105105
```
106106

107107
## str.search(regexp)

0 commit comments

Comments
(0)

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