Skip to content

Commit

Permalink
fixup! Polish documentation for the binary module
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Mar 6, 2025
1 parent a6436ef commit 90168c5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/stdlib/src/binary.erl
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ Summary of options:
in the result. See the example below.

- **trim** - Removes trailing empty parts of the result (as does `trim` in
`re:split/3`.
`re:split/3`).

- **trim_all** - Removes all empty parts of the result.

Expand Down Expand Up @@ -777,11 +777,12 @@ replace(H, N, R) ->
end.
-doc """
Constructs a new binary by replacing the parts in `Subject` matching `Pattern`
with `Replacement` if given as a literal `t:binary/0` or with the result of
applying `Replacement` to a matching subpart if given as a `fun`.
Constructs a new binary by replacing the parts in `Subject` matching
`Pattern` with `Replacement` if given as a literal
[`binary()`](`t:binary/0`) or with the result of applying
`Replacement` to a matching subpart if given as a `fun`.

If `Replacement` is given as a `t:binary/0` and the matching subpart of
If `Replacement` is given as a [`binary()`](`t:binary/0`) and the matching subpart of
`Subject` giving raise to the replacement is to be inserted in the result,
option `{insert_replaced, InsPos}` inserts the matching part into `Replacement`
at the specified position (or positions) before inserting `Replacement` into
Expand All @@ -791,7 +792,7 @@ If any position specified in `InsPos` is greater than the size of the
replacement binary, a `badarg` exception is raised.

Options `global` and `{scope, part()}` work as for `split/3`. The return type is
always a `t:binary/0`.
always [`binary()`](`t:binary/0`).

For a description of `Pattern`, see `compile_pattern/1`.

Expand Down

0 comments on commit 90168c5

Please sign in to comment.