In Lua, there are many functions that are useful to manipulate strings. We can use the
string.reverse function if we need to reverse a string.
string = string.reverse(string)
The function only needs a valid string as a mandatory parameter.
reverse function will reverse the string given as input.
In this example, we will reverse the string
ourstring = "Hello, Educative!" print(string.reverse(ourstring))
View all Courses