From f1be6a4a77cf8a6fffe4ecfb6a485590d8e19c81 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Thu, 14 Mar 2024 17:26:24 -0600 Subject: [PATCH] docs: uppercase ex with substring (#5056) --- docs/language/functions/upper.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/language/functions/upper.md b/docs/language/functions/upper.md index 4a49fc6213..ae8a88e01a 100644 --- a/docs/language/functions/upper.md +++ b/docs/language/functions/upper.md @@ -22,3 +22,13 @@ echo '"Zed"' | zq -z 'yield upper(this)' - ```mdtest-output "ZED" ``` + +[Slices](../expressions.md#slices) can be used to uppercase a subset of a string as well. + +```mdtest-command +echo '"zed"' | zq -z 'func upper_first_char(str): (upper(str[0:1]) + str[1:]) yield upper_first_char(this)' - +``` +=> +```mdtest-output +"Zed" +```