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 Examples  





2 Template data  





3 Technical details  





4 See also  














Template:Str len






Acèh
Afrikaans
Alemannisch
Алтай тил
Аԥсшәа
العربية
Արեւմտահայերէն

Asturianu
Авар
Azərbaycanca
تۆرکجه
Basa Bali

 / Bân-lâm-gú
Башҡортса
Беларуская
Беларуская (тарашкевіца)

Български
Boarisch
Bosanski
Català
Чӑвашла
Cebuano
Čeština
Dansk
Deutsch
Dolnoserbski
Eesti
Ελληνικά
Эрзянь
Español
Esperanto
Euskara
Eʋegbe
فارسی
Fiji Hindi
Føroyskt
Français
Gaeilge
Gaelg
Gagauz
Gàidhlig
Galego
گیلکی

/Hak-kâ-ngî

Hausa
Հայերեն
ि
Hornjoserbsce
Hrvatski
Ilokano
Bahasa Indonesia
Ирон
Íslenska
Italiano
עברית
Jawa


Қазақша
Kiswahili
Kurdî
Кыргызча
Кырык мары
Ladin
Лакку
Latina
Latviešu
Lëtzebuergesch
Ligure
Livvinkarjala
Magyar
ि
Македонски

Māori


مازِرونی
Bahasa Melayu
Mfantse
Minangkabau
 / Mìng-dĕ̤ng-nḡ
Мокшень
Монгол

Nederlands

 

Нохчийн
Norsk bokmål
Олык марий
ି
Oʻzbekcha / ўзбекча

Pälzisch

Plattdüütsch
Português
Română
Rumantsch
Русиньскый
Русский
Саха тыла
Sakizaya

Scots
Shqip

Simple English
Slovenčina
Slovenščina
کوردی
Српски / srpski
Svenska
ி
Taqbaylit
Tarandíne
Татарча / tatarça
 


Тоҷикӣ
Türkçe
Українська
اردو
Tiếng Vit
Volapük
Wayuunaiki


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  



Wikimedia Commons
MediaWiki
Meta-Wiki
Wikispecies
Wikibooks
Wikidata
Wikiquote
Wikisource
Wikiversity
Wiktionary
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


0

This is the {{str len}} meta-template.

It takes a string as parameter and returns its length (excluding spaces at the start and end). It can now count as high as necessary.

Examples

If the parameter is empty or undefined it is considered to be of zero length:

{{str len}} returns 0
{{str len|}} returns 0
{{str len| }} returns 0

It counts the length correctly, even if the string contains spaces, looks like a number, or contains special characters:

{{str len| ab cde }} returns 6
{{str len| 1234567 }} returns 7
{{str len| café åäö }} returns 8
{{str len| {{loop|50|abcdefghij}} }} returns 500
{{str len| {{loop|10000|abcdefghij}} }} returns 100000

Template data

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

TemplateData for Str len

The template takes a string as parameter and returns its length, excluding spaces at the start and end of the string

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Alpha-numeric text1

The string to be counted

Stringrequired

Technical details

This is the first general-purpose template to be implemented using mw:Extension:Scribunto. The Lua code is located in Module:String.

See also


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

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



This page was last edited on 13 June 2021, at 14:08 (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