Skip to content

Commit 411169c

Browse files
committed
[string functions] Clarify that replace does not always replace all occurrences
1 parent dc78cef commit 411169c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

functions/replace.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ returns:
1919
type: string
2020
desc: ''
2121
desc: |
22-
Given the `subject` string, `replace()` replaces all ocurrences of the `old` substring with the `new` substring.
22+
Given the `subject` string, `replace()` replaces ocurrences of the `old` substring with the `new` substring.
2323
2424
The `count` optional parameter specifies how many occurrences of the `old` substring in `subject` are to be replaced.
2525
If this parameter is omitted, all occurrences are replaced. If `count` is negative, an error MUST be raised.

jep-014-string-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ If the `$subject` string has length greater than or equal to `$width`, it is ret
126126
```
127127
string replace(string $subject, string $old, string $new[, number $count])
128128
```
129-
Given the `$subject` string, `replace()` replaces all occurrences of the `$old` substring with the `$new` substring.
129+
Given the `$subject` string, `replace()` replaces occurrences of the `$old` substring with the `$new` substring.
130130

131131
The `$count` optional parameter specifies how many occurrences of the `$old` substring in `$subject` are replaced. If this parameter is omitted, all occurrences are replaced. If `$count` is negative, an error MUST be raised.
132132

0 commit comments

Comments
 (0)