negative substring

This commit is contained in:
James Bardin 2021-05-18 16:03:23 -04:00
parent f684f91f3f
commit 760a59b3a7
1 changed files with 9 additions and 0 deletions

View File

@ -29,3 +29,12 @@ bytes:
> substr("🤔🤷", 0, 1) > substr("🤔🤷", 0, 1)
🤔 🤔
``` ```
The offset index may be negative, in which case it is relative to the end of
the given string. The length may be -1, in which case the remainder of the
string after the given offset will be returned.
```
> substr("hello world", -5, -1)
world
```