WoW:API strrep: Difference between revisions

2 bytes removed ,  15 August 2023
m
Move page script moved page API strrep to WoW:API strrep without leaving a redirect
No edit summary
m (Move page script moved page API strrep to WoW:API strrep without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{:Lua/Libshortcut|strrep|string.rep}}
{{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 10: Line 11:
  Lua
  Lua
  Lua
  Lua
  > = ("Lua!"):rep(3)  -- naturally.
  > = ("Fire! "):rep(3)  -- naturally.
  Lua!Lua!Lua!
  Fire! Fire! Fire!
 
{{LUA}}
Anonymous user