Template:String-handling templates: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>Davidgothberg Removing {{strlen}}, since that one now is a redirect to {{str len}}. |
meta>Davidgothberg The <noinclude> caused a very hard to find bug when I copied some of these links to Template:Str len/core/doc. Making the <noinclude> more visible so others won't fall in the same trap. |
||
Line 13: | Line 13: | ||
* [[mw:Help:Magic words]] – About <code><nowiki>{{padleft:|}}</nowiki></code>. | * [[mw:Help:Magic words]] – About <code><nowiki>{{padleft:|}}</nowiki></code>. | ||
* [[mw:Help:Extension:ParserFunctions]] – About <code><nowiki>{{#ifeq:|||}}</nowiki></code> etc.<noinclude> | * [[mw:Help:Extension:ParserFunctions]] – About <code><nowiki>{{#ifeq:|||}}</nowiki></code> etc. <!-- | ||
--><noinclude> | |||
{{documentation}} | {{documentation}} | ||
<!-- Add categories and interwikis to the /doc subpage, not here! --> | <!-- Add categories and interwikis to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |
Revision as of 16:34, 30 March 2009
Easy to use and efficient string length comparison templates:
- {{str ≥ len}} – To check if a string is "longer or equally long" vs. "shorter" than a given length.
- {{str ≤ len}} – To check if a string is "shorter or equally long" vs. "longer" than a given length.
- {{str ≠ len}} – To check if a string is "not equal" vs. "equal" to a given length.
- {{str ≤ ≥ len}} – To check all three of "shorter", "equal" and "longer" at the same time.
Much less efficient string length template:
- {{str len}} – Takes a string as parameter and returns its length. Can count up to 500 in length.
Technical stuff:
- mw:Help:Magic words – About
{{padleft:|}}
. - mw:Help:Extension:ParserFunctions – About
{{#ifeq:|||}}
etc.