WoW:API strrep

From AddOn Studio
Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API strrep to API strrep without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW Lua

Generate a string which is n copies of the string passed concatenated together.

string.rep(s, n)
strrep(s, n)

Examples

> = string.rep("Lua ",5)
Lua Lua Lua Lua Lua
> = string.rep("Lua\n",3)
Lua
Lua
Lua
> = ("Fire! "):rep(3)  -- naturally.
Fire! Fire! Fire!