toupper()

Learn how to use the toupper() function to convert a string to upper case.

Converts a string to upper case.

Syntax

toupper(value)

Parameters

NameTypeRequiredDescription
valuestring✔️The value to convert to an uppercase string.

Returns

If conversion is successful, result is an uppercase string. If conversion isn’t successful, result is null.

Example

The following example checks whether the toupper() function converted the lowercase input string to uppercase.

toupper("hello") == "HELLO"