Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  





2 Examples  





3 Template data  





4 See also  














Template:Loop






Alemannisch
العربية
Արեւմտահայերէն

Asturianu
تۆرکجه
Basa Bali

Basa Banyumasan
Беларуская

Български

Bosanski
Català
Čeština
Dansk
Deutsch
Dolnoserbski
Eesti
Ελληνικά
Español
Esperanto
Euskara
فارسی
Français
Galego


Հայերեն
ि
Hornjoserbsce
Hrvatski
Ilokano
Bahasa Indonesia
Interlingua
Íslenska
Italiano
Jawa

Kurdî
Lietuvių
Ligure
Magyar
Македонски

Malti
Māori


مصرى
Bahasa Melayu

Nederlands


Napulitano
Norsk bokmål
Norsk nynorsk
ି


Tok Pisin
Português

Scots
Shqip

Simple English
Slovenčina
Slovenščina
کوردی
Српски / srpski
Suomi
Svenska
ி
Tarandíne


Türkçe
Українська
Tiếng Vit

Yorùbá

Zazaki

 
 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



MediaWiki
Multilingual Wikisource
Wikibooks
Wikisource
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 

(Redirected from Template:Repeat)

This template is used to produce a simple loop. It is based on Module:String, and there is no limit to the number of iterations it can perform.

Usage

{{loop|times to repeat|string}}

Ifstring contains an equals sign, you must put "|2=string" instead of "|string".

Examples

Code Output
{{loop|4|n}} nnnn
{{loop|25|test me}} test metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest metest me
{{#expr:2{{loop|50|*2}}}} 2.2517998136852E+15
{{loop|3|{{CURRENTYEAR}}}} 202420242024
{{loop|{{#expr:7*2}}|  '''MUDA}}!   MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA  MUDA!

When the string being replicated includes "=", we have to precede the second parameter with "2=", or use {{=}}.

Code Output
{{loop|9|2==}} =========
{{loop|9|{{=}}}} =========

Surrounding whitespace is always stripped; you must use {{#invoke:string|rep}} instead to preserve it.

Code Output
{{#invoke:String|rep| hello |3}} hello hello hello
{{loop|3| hello }} hellohellohello"

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Loop in articles based on its TemplateData.

TemplateData for Loop

The template is used to produce a simple loop of repeated strings.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Number1

Number of times to repeat

Numberrequired
String2

The string to be repeated. Use {{=}} if the string contains an equals sign.

Stringrequired

See also


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Loop&oldid=774490282"

Categories: 
Templates based on the String Lua module
Wikipedia utility templates
Hidden categories: 
Wikipedia template-protected templates
Templates using TemplateData
 



This page was last edited on 8 April 2017, at 20:28 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki