Lua .lower()

Anonymous contributor's avatar
Anonymous contributor
Published Oct 3, 2023Updated Dec 22, 2024
Contribute to Docs

The string.lower() function receives a string and returns a transformed copy with all uppercase letters changed to lowercase, and all other characters unchanged. Uppercase characters are defined by the current locale.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn the basics of Lua, a general-purpose programming language used for building games, web apps, and developer tools.
    • Beginner Friendly.
      4 hours

Syntax

string.lower( s )

Where s is a string.

Returns a copy of s with letters that are uppercase in the current locale converted to lowercase. The string s is unmodified.

Example

The code below demonstrates a basic implementation of the string.lower() function.

stringvar = string.lower("HOw Now Brown CoW?")
print(stringvar)

This will result in the following output:

how now brown cow?

All contributors

Contribute to Docs

Learn Lua on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn the basics of Lua, a general-purpose programming language used for building games, web apps, and developer tools.
    • Beginner Friendly.
      4 hours