Editing Template:Str len/doc
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | {{ | + | {{documentation subpage}} |
− | {{ | + | {{used in system}} |
− | {{ | + | {{lua|Module:String}} |
− | <! | + | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> |
+ | |||
This is the {{tl|str len}} meta-template. | This is the {{tl|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. | 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=== | + | === Examples === |
+ | |||
If the parameter is empty or undefined it is considered to be of zero length: | If the parameter is empty or undefined it is considered to be of zero length: | ||
Line 25: | Line 27: | ||
:<code><nowiki>{{str len| 1000-characters... }}</nowiki></code> returns {{str len| abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghij }} | :<code><nowiki>{{str len| 1000-characters... }}</nowiki></code> returns {{str len| abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghij }} | ||
− | + | ==Template data== | |
− | |||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "The template takes a string as parameter and returns its length, excluding spaces at the start and end of the string", | "description": "The template takes a string as parameter and returns its length, excluding spaces at the start and end of the string", | ||
"params": { | "params": { | ||
− | " | + | "string": { |
"label": "Alpha-numeric text", | "label": "Alpha-numeric text", | ||
"description": "The string to be counted", | "description": "The string to be counted", | ||
Line 41: | Line 42: | ||
</templatedata> | </templatedata> | ||
− | ===Technical details=== | + | === Technical details === |
+ | |||
This is the first general-purpose template to be implemented using [[mw:Extension:Scribunto]]. The Lua code is located in [[Module:String]]. | This is the first general-purpose template to be implemented using [[mw:Extension:Scribunto]]. The Lua code is located in [[Module:String]]. | ||
− | ===See also=== | + | === See also === |
− | {{ | + | |
+ | {{navbox string handling templates}} | ||
<includeonly> | <includeonly> | ||
− | + | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | |
− | <! | + | [[Category:String manipulation templates|{{PAGENAME}}]] |
− | [[Category:String manipulation templates]] | + | |
− | |||
</includeonly> | </includeonly> |