Skip to main content
Version: Next

upper

Function

upper convert a string to upper case

Synopsis

upper(s: string) -> string

Description

The upper function converts all lower case Unicode characters in s to upper case and returns the result.

Examples

echo '"Super JSON"' | super -z -c 'yield upper(this)' -

=>

"SUPER JSON"

Slices can be used to uppercase a subset of a string as well.

echo '"super JSON"' |
super -z -c 'func capitalize(str): (
upper(str[0:1]) + str[1:]
)
yield capitalize(this)
' -

=>

"Super JSON"