Skip to content

Commit 500687f

Browse files
committed
Fixed incorrect bounds for find_first default end parameter.
1 parent ec97060 commit 500687f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jep-014-string-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Given the `$subject` string, `find_first()` returns the zero-based index of the
2424
The `$start` and `$end` parameters are optional and allow restricting the range within `$subject` in which `$sub` must be found.
2525

2626
- If `$start` is omitted, it defaults to `0` (which is the start of the `$subject` string).
27-
- If `$end` is omitted, it defaults to `length(subject) - 1` (which is is the end of the `$subject` string).
27+
- If `$end` is omitted, it defaults to `length(subject)` (which is past the end of the `$subject` string).
2828

2929
Contrary to similar functions found in most popular programming languages, the `find_first()` function does not return `-1` if no occurrence of the substring can be found. Instead, it returns `null` for consistency reasons with how JMESPath behaves.
3030

0 commit comments

Comments
 (0)