WoW:API strrep: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API strrep to API strrep without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{luaapi}}
Generate a string which is n copies of the string passed concatenated together.
  string.rep(s, n)
  string.rep(s, n)
strrep(s, n)


Generate a string which is n copies of the string passed concatenated together.
== Examples ==
 
  > = string.rep("Lua ",5)
  > = string.rep("Lua ",5)
  Lua Lua Lua Lua Lua
  Lua Lua Lua Lua Lua
Line 9: Line 11:
  Lua
  Lua
  Lua
  Lua
 
> = ("Fire! "):rep(3)  -- naturally.
[[Category:API Functions|strrep]]
Fire! Fire! Fire!
[[Category:API String Functions|strrep]]

Latest revision as of 04:47, 15 August 2023

WoW Lua

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

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

Examples[edit]

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