What is string.upper in Lua?

In Lua, you can make all the characters of a string upper case via the string.upper() function.

%0 node_1 Hello, Educative! node_3 string.upper() node_1->node_3 node_1636478286136 HELLO, EDUCATIVE! node_3->node_1636478286136

Syntax


string.upper(str)

Parameters

  • str: The function needs a string as a mandatory parameter.

Return value

  • The function will return the string with each character as upper case.

Code

us = string.upper("Hello, Educative!")
print(us)

Output


HELLO, EDUCATIVE!

Free Resources