Clarify replace(...)'s behavior on nil
This commit is contained in:
parent
78afa73e01
commit
5ae3010e5a
1 changed files with 2 additions and 1 deletions
|
|
@ -69,7 +69,8 @@ Perl and Javascript use.
|
||||||
[[proc-replace]]
|
[[proc-replace]]
|
||||||
==== replace(string, Regex, sub): string
|
==== replace(string, Regex, sub): string
|
||||||
|
|
||||||
Replaces each match of Regex in the string with `sub`.
|
Replaces each match of Regex in the string with `sub`, which should never be
|
||||||
|
or return `nil`.
|
||||||
|
|
||||||
If `sub` is a `proc (RegexMatch): string`, then it is executed with each match
|
If `sub` is a `proc (RegexMatch): string`, then it is executed with each match
|
||||||
and the return value is the replacement value.
|
and the return value is the replacement value.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue