Convert a string to upper or lower case

Verified
Added by iNTERFACEWARE

Convert a string to upper case with string.upper(), or lower case with string.lower()

Source Code
   -- convert a string to upper case
   local s = 'hello world'
   s = s:upper()
   --> 'HELLO WORLD'

   -- convert a string to lower case
   local s = 'HELLO WORLD'
   s = s:lower()
   --> 'hello world'
Description
Convert a string to upper case with string.upper(), or lower case with string.lower()
Usage Details

Use string.upper() to convert a string to uppercase, and string.lower() to convert a string to lowercase.

How to use the snippet:

  • Paste the desired conversion into your script

Note: You may also want to look at the capitalize() function in the stringutil module.