Skip to content

Commit dd46ead

Browse files
committed
Fix String.split/3 example in guide
1 parent 2ab8a54 commit dd46ead

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/elixir/pages/getting-started/keywords-and-maps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ We can also use options to limit the splitting algorithm to a maximum number of
3333

3434
```elixir
3535
iex> String.split("1 2 3", " ", [trim: true, parts: 2])
36-
["1", "2 3"]
36+
["1", " 2 3"]
3737
```
3838

3939
`[trim: true]` and `[trim: true, parts: 2]` are keyword lists. When a keyword list is the last argument of a function, we can skip the brackets and write:
4040

4141
```elixir
4242
iex> String.split("1 2 3", " ", trim: true, parts: 2)
43-
["1", "2 3"]
43+
["1", " 2 3"]
4444
```
4545

4646
As shown in the example above, keyword lists are mostly used as optional arguments to functions.

0 commit comments

Comments
 (0)