From 760a59b3a76513b3a35ff4088899ba8a1ad61443 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 18 May 2021 16:03:23 -0400 Subject: [PATCH] negative substring --- website/docs/language/functions/substr.html.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/docs/language/functions/substr.html.md b/website/docs/language/functions/substr.html.md index 21b3bbc31..a9691f5b2 100644 --- a/website/docs/language/functions/substr.html.md +++ b/website/docs/language/functions/substr.html.md @@ -29,3 +29,12 @@ bytes: > 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 +```