ππ°πΏππ°πΌπ΄π»π΄πΉπ½π:Str len/doc
This is a documentation subpage for ππ°πΏππ°πΌπ΄π»π΄πΉπ½π:Str len. It contains usage information, categories and other content that is not part of the original ππ°πΏππ°πΌπ΄π»π΄πΉπ½π page. |
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| 499-characters... }}
returns 499{{Str len| 1000-characters... }}
returns 999
Template data[πΉπ½πΌπ°πΉπ³π΄πΉ]
This is the TemplateData documentation for this template used by VisualEditor and other tools.
TemplateData for Str lenThe template takes a string as parameter and returns its length, excluding spaces at the start and end of the string
Parameter | Description | Type | Status | |
---|---|---|---|---|
Alpha-numeric text | 1 | The string to be counted | String | required |
See also[πΉπ½πΌπ°πΉπ³π΄πΉ]
ππ°πΏππ°πΌπ΄π»π΄πΉπ½π:String-handling templates