Template:Len
Jump to navigation
Jump to search
0
Usage[edit]
Finds min(length,498) for the expanded wikitext of a given wikitext, including possible spaces, even at the start and end. A newline counts as one character.
Examples[edit]
"{{len|abc}}"
→ "3" [1]"{{len|abc&s}}"
→ "4" [2]"{{len|&sabc}}"
→ "4" [3]"{{len|&sabc&s}}"
→ "5" [4]"{{len|&s&s&s}}"
→ "3" [5]"{{len|&nl}}"
→ "1" [6]"{{len|ab&nlc}}"
→ "4" [7]"{{len|aaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccc ddddddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeeeeee}}"
→ "127" [8]"{{len|<span class="nowrap"><code>{{tlc|...}}</code></span>}}"
→ "77" [9]"{{len|123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123}}"
→ "498" [10]
To find the length of the trimmed string, add "1=" in front:
"{{len|1= abc }}"
gives "3"
<nowiki> tags and their content are internally replaced by a code, affecting the length:
{{len|<nowiki>{{tc}}</nowiki>}}"
gives "34"{{len|<nowiki>abc{{tc}}</nowiki>}}"
gives "34"