Skip to content

Commit 2e0a1fe

Browse files
authored
Update arity of String.split (#13151)
`String.split/2` is mentioned, but `String.split/1` is actually used in the example.
1 parent d348606 commit 2e0a1fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/pages/getting-started/lists-and-tuples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ iex> String.split("hello beautiful world")
150150
["hello", "beautiful", "world"]
151151
```
152152

153-
The `String.split/2` function breaks a string into a list of strings on every whitespace character. Since the amount of elements returned depends on the input, we use a list.
153+
The `String.split/1` function breaks a string into a list of strings on every whitespace character. Since the amount of elements returned depends on the input, we use a list.
154154

155155
On the other hand, `String.split_at/2` splits a string in two parts at a given position. Since it always returns two entries, regardless of the input size, it returns tuples:
156156

0 commit comments

Comments
 (0)