<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://moasspedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_%E2%89%A0_len%2Fdoc</id>
	<title>Template:Str ≠ len/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://moasspedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_%E2%89%A0_len%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://moasspedia.org/w/index.php?title=Template:Str_%E2%89%A0_len/doc&amp;action=history"/>
	<updated>2026-04-13T07:15:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://moasspedia.org/w/index.php?title=Template:Str_%E2%89%A0_len/doc&amp;diff=31756&amp;oldid=prev</id>
		<title>Wikipedia&gt;GKFX: remove obsolete comment</title>
		<link rel="alternate" type="text/html" href="https://moasspedia.org/w/index.php?title=Template:Str_%E2%89%A0_len/doc&amp;diff=31756&amp;oldid=prev"/>
		<updated>2021-11-20T09:19:46Z</updated>

		<summary type="html">&lt;p&gt;remove obsolete comment&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{high-use}}{{lua|Module:String}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the {{tl|str ≠ len}} meta-template.&lt;br /&gt;
&lt;br /&gt;
It helps other templates check if a string is &amp;quot;not equal&amp;quot; vs. &amp;quot;equal&amp;quot; to a given length.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note!&amp;#039;&amp;#039;&amp;#039; For most usage cases it might be better to use {{tl|str ≥ len}}. (See the [[#See also|see also]] section below.) &lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This template takes 3 to 4 unnamed parameters.&lt;br /&gt;
&lt;br /&gt;
Here is how to check if the string &amp;quot;abcde&amp;quot; is exactly 5 characters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{str ≠ len | abcde | 5&lt;br /&gt;
| Not equal.&lt;br /&gt;
| Equal.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which returns this:&lt;br /&gt;
&lt;br /&gt;
:{{str ≠ len | abcde | 5&lt;br /&gt;
| Not equal.&lt;br /&gt;
| Equal.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Templates have a problem to handle parameter data that contains equal signs &amp;quot;&amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&amp;quot;. But that is easily solved by using numbered parameters. Here we check if the string &amp;quot;ab=cde&amp;quot; is exactly 100 characters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{str ≠ len &lt;br /&gt;
| 1 = ab=cde &lt;br /&gt;
| 2 = 100&lt;br /&gt;
| 3 = Not equal, &amp;quot;!=&amp;quot;.&lt;br /&gt;
| 4 = Equal, &amp;quot;=&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which returns this:&lt;br /&gt;
&lt;br /&gt;
:{{str ≠ len &lt;br /&gt;
| 1 = ab=cde &lt;br /&gt;
| 2 = 100&lt;br /&gt;
| 3 = Not equal, &amp;quot;!=&amp;quot;.&lt;br /&gt;
| 4 = Equal, &amp;quot;=&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It probably is a good habit to always use the numbered parameters, since you might not know beforehand exactly how the data will look that your template will feed to this meta-template.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
Detailed parameter explanation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{str ≠ len &lt;br /&gt;
| 1 = A string&lt;br /&gt;
| 2 = A length&lt;br /&gt;
| 3 = Data to return/render when &amp;quot;not equally long&amp;quot;.&lt;br /&gt;
| 4 = Data to return/render when &amp;quot;equally long&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Empty or undefined strings are considered to be of 0 length.&lt;br /&gt;
&lt;br /&gt;
Length values below 0 are considered to be 0.&lt;br /&gt;
&lt;br /&gt;
=== Technical details ===&lt;br /&gt;
This template would be equivalent to templates named &amp;lt;nowiki&amp;gt;{{str != len}} or {{str == len}}&amp;lt;/nowiki&amp;gt;, but we can&amp;#039;t use those template names since they don&amp;#039;t work well in MediaWiki.&lt;br /&gt;
&lt;br /&gt;
[[Help:Template|Templates]] have problems to handle parameter data that contains pipes &amp;quot;&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;&amp;quot;, unless the pipe is inside another template &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{name|param1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or inside a piped link &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Help:Template|help]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Thus templates can not handle [[Help:Table|wikitables]] as input unless you escape them by using the {{tn|!}} template. This makes it hard to use wikitables as parameters to templates. Instead the usual solution is to use &amp;quot;[[Help:HTML in wikitext|HTML wikimarkup]]&amp;quot; for the table code, which is more robust.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
{{string-handling templates}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- CATEGORIES AND INTERWIKIS HERE, THANKS --&amp;gt;&lt;br /&gt;
[[Category:String manipulation templates|{{PAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;GKFX</name></author>
	</entry>
</feed>