mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
Clarify replace(...)'s behavior on nil
This commit is contained in:
@@ -69,7 +69,8 @@ Perl and Javascript use.
|
||||
[[proc-replace]]
|
||||
==== 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
|
||||
and the return value is the replacement value.
|
||||
|
||||
Reference in New Issue
Block a user