Skip to content

Commit

Permalink
docs: uppercase ex with substring (#5056)
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly authored Mar 14, 2024
1 parent 38763f8 commit f1be6a4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/language/functions/upper.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

0 comments on commit f1be6a4

Please sign in to comment.