Template:Str letter
0
File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=Wikipedia:Lua | Uses Lua:
|
This is the {{str letter}} meta-template.
It takes a string as parameter, and returns its length of preceding letters.
Examples
If the parameter is empty or undefined it is considered to be of zero length:
{{str letter}}
returns 0{{str letter|}}
returns 0{{str letter| }}
returns 0
The count is interrupted by numbers, symbols, and punctuation:
{{str letter|12345}}
returns 0{{str letter|abcdef?}}
returns 6{{str letter|abc def}}
returns 3{{str letter|ABcD123}}
returns 4{{str letter|abc, def}}
returns 3{{str letter|abc(def)}}
returns 3{{str letter|abc xyzabcdefghijklmnopqrstuvwxyz}}
returns 3{{str letter|ÁbČĐÈęFğ}}
returns 8{{str letter|NR<ref>a reference</ref>}}
returns 2
{{str letter|abcdefghijklmnopqrstuvwx}}
returns 24{{str letter|abcdefghijklmnopqrstuvwxyz}}
returns 26
See also
Script error: The function "navbox" does not exist.
References
- ↑ a reference
The above documentation is transcluded from Template:Str letter/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |