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