string.reverse
Return the given str with the character order reversed.
|
|||
| Read a line from the user, then print the same input reversed. | |||
| Code | <nowiki>
print(string.reverse(read()))
</nowiki>
|
||
| Output | Depends on what the user wrote. For instance, if they were to enter Hello World, the output would be dlroW olleH. |
||
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC:Tweaked |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string.reverse Function | |
|---|---|
|
Syntax string.reverse(
Colon notation: str:reverse() | |
| Returns | string |
| API | string |
| Source | Lua (source) |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.