<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3AString2%2Fdoc</id>
	<title>Module:String2/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3AString2%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:String2/doc&amp;action=history"/>
	<updated>2026-04-08T00:58:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:String2/doc&amp;diff=12204&amp;oldid=prev</id>
		<title>Caleb Cooper at 17:37, 18 October 2020</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:String2/doc&amp;diff=12204&amp;oldid=prev"/>
		<updated>2020-10-18T17:37:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:37, 18 October 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{module rating|release}}&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{module rating|release}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Commons Import}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The module &#039;&#039;&#039;String2&#039;&#039;&#039; contains five case-related calls that convert strings to upper, lower, sentence or title case and two calls that are useful for working with substrings. There are two utility calls that strip leading zeros from padded numbers and transform text so that it is not interpreted as wikitext.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The module &#039;&#039;&#039;String2&#039;&#039;&#039; contains five case-related calls that convert strings to upper, lower, sentence or title case and two calls that are useful for working with substrings. There are two utility calls that strip leading zeros from padded numbers and transform text so that it is not interpreted as wikitext.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:String2/doc&amp;diff=12201&amp;oldid=prev</id>
		<title>Caleb Cooper: Created page with &quot;{{module rating|release}} The module &#039;&#039;&#039;String2&#039;&#039;&#039; contains five case-related calls that convert strings to upper, lower, sentence or title case and two calls that are useful...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:String2/doc&amp;diff=12201&amp;oldid=prev"/>
		<updated>2020-10-18T17:32:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{module rating|release}} The module &amp;#039;&amp;#039;&amp;#039;String2&amp;#039;&amp;#039;&amp;#039; contains five case-related calls that convert strings to upper, lower, sentence or title case and two calls that are useful...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{module rating|release}}&lt;br /&gt;
The module &amp;#039;&amp;#039;&amp;#039;String2&amp;#039;&amp;#039;&amp;#039; contains five case-related calls that convert strings to upper, lower, sentence or title case and two calls that are useful for working with substrings. There are two utility calls that strip leading zeros from padded numbers and transform text so that it is not interpreted as wikitext.&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
=== upper ===&lt;br /&gt;
The upper function simply converts all characters to upper case.&lt;br /&gt;
&lt;br /&gt;
=== lower ===&lt;br /&gt;
The lower function simply converts all characters to lower case.&lt;br /&gt;
&lt;br /&gt;
=== title ===&lt;br /&gt;
The title function capitalises the first letter of each word in the text, apart from a number of short words recommended by [[s:U.S. Government Printing Office Style Manual/Capitalization Rules|The U.S. Government Printing Office Style Manual]]: {{xt|a, an, the, at, by, for, in, of, on, to, up, and, as, but, or, and nor}}.&lt;br /&gt;
&lt;br /&gt;
=== sentence ===&lt;br /&gt;
The sentence function finds the first letter and capitalises it, then renders the rest of the text in lower case. It works properly with text containing wiki-markup. Compare &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2|sentence|[[action game]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; -&amp;gt; {{#invoke:String2|sentence|[[action game]]}} with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ucfirst:{{lc:[[action game]]}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; -&amp;gt; {{ucfirst:{{lc:[[action game]]}}}}. Piped wiki-links are handled as well:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2|sentence|[[trimix (breathing gas)|trimix]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; -&amp;gt; {{#invoke:String2|sentence|[[trimix (breathing gas)|trimix]]}}&lt;br /&gt;
So are lists:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 |sentence |{{hlist ||[[apples]] |[[pears]] |[[oranges]]}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:String2 |sentence |{{hlist |[[apples]] |[[pears]] |[[oranges]]}}}}&lt;br /&gt;
&lt;br /&gt;
=== ucfirst ===&lt;br /&gt;
The ucfirst function is similar to sentence; it renders the first alphabetical character in upper case, but leaves the capitalisation of the rest of the text unaltered. This is useful if the text contains proper nouns, but it will not regularise sentences that are ALLCAPS, for example. It also works with text containing piped wiki-links and with html lists. &amp;lt;s&amp;gt;&amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; is an alias to this function for backward compatibility.&amp;lt;/s&amp;gt;(now obselete)&lt;br /&gt;
&lt;br /&gt;
=== posnq ===&lt;br /&gt;
* posnq (position, no quotes) returns the numerical start position of the first occurrence of one piece of text (&amp;quot;match&amp;quot;) inside another (&amp;quot;str&amp;quot;).&lt;br /&gt;
* It returns nil if no match is found, or if either parameter is blank.&lt;br /&gt;
* It takes the text to be searched in as the first unnamed parameter, which is trimmed.&lt;br /&gt;
* It takes the text to match as the second unnamed parameter, which is trimmed and any double quotes &amp;quot; are stripped out. That allows spaces at the beginning or end of the match string to be included in a consistent manner.&lt;br /&gt;
&lt;br /&gt;
=== split ===&lt;br /&gt;
The &amp;#039;&amp;#039;split&amp;#039;&amp;#039; function splits text at boundaries specified by separator and returns the chunk for the index idx (starting at 1). It can use positional parameters or named parameters (but these should not be mixed):&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 |split |text |separator |index |true/false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 |split |txt=text |sep=separator |idx=index |plain=true/false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Any double quotes (&amp;quot;) in the separator parameter are stripped out, which allows spaces and wikitext like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[&amp;quot;[&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to be passed. Use &amp;lt;code&amp;gt;{{tl|!}}&amp;lt;/code&amp;gt; for the pipe character &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the optional plain parameter is set to &amp;lt;code&amp;gt;false / no / 0&amp;lt;/code&amp;gt; then separator is treated as a Lua pattern. The default is plain=true, i.e. normal text matching.&lt;br /&gt;
&lt;br /&gt;
The index parameter is optional; it defaults to the first chunk of text.&lt;br /&gt;
&lt;br /&gt;
The [[Template:Stringsplit]] is a convenience wrapper for the split function.&lt;br /&gt;
&lt;br /&gt;
=== stripZeros ===&lt;br /&gt;
The stripZeros functions finds the first number in a string of text and strips leading zeros, but retains a zero which is followed by a decimal point. For example: &amp;quot;0940&amp;quot; -&amp;gt; &amp;quot;940&amp;quot;; &amp;quot;Year: 0023&amp;quot; -&amp;gt; &amp;quot;Year: 23&amp;quot;; &amp;quot;00.12&amp;quot; -&amp;gt; &amp;quot;0.12&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== nowiki ===&lt;br /&gt;
The nowiki function ensures that a string of text is treated by the MediaWiki software as just a string, not code. It trims leading and trailing whitespace.&lt;br /&gt;
&lt;br /&gt;
=== val2percent ===&lt;br /&gt;
The val2percent functions scans through a string, passed as either the first unnamed parameter or |txt=, and converts each number it finds into a percentage, then returns the resulting string.&lt;br /&gt;
&lt;br /&gt;
=== one2a ===&lt;br /&gt;
The one2a function scans through a string, passed as either the first unnamed parameter or |txt=, and converts each occurrence of &amp;#039;one &amp;#039; into either &amp;#039;a &amp;#039; or &amp;#039;an &amp;#039;, then returns the resultant string.&lt;br /&gt;
&lt;br /&gt;
The [[Template:One2a]] is a convenience wrapper for the one2a function.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | upper |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Shifts all characters to uppercase&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | lower |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Shifts all characters to lowercase&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | sentence |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Capitalizes the first character and shifts the rest to lowercase&lt;br /&gt;
** Although similar to [[Help:Magic_words#Formatting|magic words]]&amp;#039; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ucfirst:}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; function, this call works even with piped wiki-links because it searches beyond leading brackets and other non-alphanumeric characters.&lt;br /&gt;
** It now also recognises when it has an html list passed to it and capitalises the first alphabetic letter beyond the list item markup ({{tag|li|o}}) and any piped links that may be there.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | ucfirst |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Capitalizes the first alphabetic character and leaves the rest unaltered&lt;br /&gt;
** Works with piped wiki-links and html lists&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | title |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Capitalizes all words, except for &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;the&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;at&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;for&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;of&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;on&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;to&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;as&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;but&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;nor&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | stripZeros |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Removes leading padding zeros from the first number it finds in the string&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 | title |…}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Renders the string as plain text without wikicode&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
These functions take one unnamed parameter comprising (or invoking as a string) the text to be manipulated:&lt;br /&gt;
* upper&lt;br /&gt;
* lower&lt;br /&gt;
* title&lt;br /&gt;
* sentence&lt;br /&gt;
* ucfirst&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Input&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Output&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| upper | abcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| upper | abcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| upper | abCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| upper | abCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| upper | ABcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| upper | ABcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| upper | ABCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| upper | ABCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| upper | }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| upper | }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| lower | abcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| lower | abcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| lower | abCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| lower | abCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| lower | ABcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| lower | ABcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| lower | ABCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| lower | ABCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| lower | }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| lower | }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | abcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | abcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | abCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | abCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | ABcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | ABcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | ABCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | ABCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | 123abcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | 123abcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| ucfirst | human X chromosome }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| ucfirst | human X chromosome}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | abcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | abcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | abCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | abCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | ABcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | ABcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | ABCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | ABCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | [[action game]] }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | [[action game]] }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | [[trimix (breathing gas)|trimix]] }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | [[trimix (breathing gas)|trimix]] }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2 | sentence | {{#invoke:WikidataIB |getValue |P136 |fetchwikidata=ALL |onlysourced=no |qid=Q1396889}} }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2 | sentence | {{#invoke:WikidataIB |getValue |P136 |fetchwikidata=ALL |onlysourced=no |qid=Q1396889}} }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2 | sentence | {{#invoke:WikidataIB |getValue |P106 |fetchwikidata=ALL |list=hlist |qid=Q453196}} }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2 | sentence | {{#invoke:WikidataIB |getValue |P106 |fetchwikidata=ALL |list=hlist |qid=Q453196}} }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| sentence | }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| sentence | }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| title | abcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| title | abcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| title | abCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| title | abCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| title | ABcd }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| title | ABcd }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| title | ABCD }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| title | ABCD }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| title | }}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| title | }}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{#invoke:String2| title | the vitamins are in my fresh california raisins}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| {{#invoke:String2| title | the vitamins are in my fresh california raisins}}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Posnq ===&lt;br /&gt;
[[Template:Posnq]] is a convenience wrapper for the posnq function.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Posnq |This is a piece of text to be searched |piece of }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Posnq |This is a piece of text to be searched |piece of }}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Posnq |This is a piece oftext to be searched |piece of }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Posnq |This is a piece oftext to be searched |piece of }}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Posnq |This is a piece of text to be searched |&amp;quot;piece of &amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Posnq |This is a piece of text to be searched |&amp;quot;piece of &amp;quot;}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Posnq |This is a piece oftext to be searched |&amp;quot;piece of &amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Posnq |This is a piece oftext to be searched |&amp;quot;piece of &amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
=== Stringsplit ===&lt;br /&gt;
[[Template:Stringsplit]] is a convenience wrapper for the split function.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;| 4}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;| 4}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |This is a piece of text to be split |x| 2}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |x| 2}}&lt;br /&gt;
Modules may return strings with | as separators like this: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |{{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}|{{!}}| 2}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |{{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}|{{!}}| 2}}&lt;br /&gt;
Lua patterns can allow splitting at classes of characters such as punctuation:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 2 |false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 2 |false}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 4 |false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 4 |false}}&lt;br /&gt;
Or split on anything that isn&amp;#039;t a letter (no is treated as false):&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit |Apples pears oranges;  Cats  dogs|&amp;quot;%A+&amp;quot;| 4 |no}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |Apples pears oranges;  Cats  dogs|&amp;quot;%A+&amp;quot;| 4 |no}}&lt;br /&gt;
Named parameters force the trimming of leading and trailing spaces in the parameters and are generally clearer when used:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Stringsplit | txt=Apples pears oranges;  Cats  dogs | sep=&amp;quot;%A+&amp;quot; | idx=3 | plain=false }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit | txt=Apples pears oranges;  Cats  dogs | sep=&amp;quot;%A+&amp;quot; | idx=3 | plain=false }}&lt;br /&gt;
&lt;br /&gt;
=== One2a ===&lt;br /&gt;
[[Template:One2a]] is a convenience wrapper for the one2a function. &lt;br /&gt;
&lt;br /&gt;
Capitalisation is kept. Aimed for usage with {{tl|Convert}}.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{one2a |One foot. One mile. One kilometer. One inch.One amp. one foot. one mile. one inch. Alone at last. Onely the lonely. ONE ounce. One monkey.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; →&lt;br /&gt;
:{{one2a |One foot. One mile. One kilometer. One inch.One amp. one foot. one mile. one inch. Alone at last. Onely the lonely. ONE ounce. One monkey.}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{convert|1|ft|spell=on}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{convert|1|ft|spell=on}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{one2a|{{convert|1|ft|spell=on}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{one2a|{{convert|1|ft|spell=on}}}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{convert|2.54|cm|0|disp=out|spell=on}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{convert|2.54|cm|0|disp=out|spell=on}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{one2a|{{convert|2.54|cm|0|disp=out|spell=on}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{one2a|{{convert|2.54|cm|0|disp=out|spell=on}}}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Module:String]] for the following functions:&lt;br /&gt;
* len&lt;br /&gt;
* sub&lt;br /&gt;
* sublength&lt;br /&gt;
* match&lt;br /&gt;
* pos&lt;br /&gt;
* str_find&lt;br /&gt;
* find&lt;br /&gt;
* replace&lt;br /&gt;
* rep&lt;br /&gt;
&lt;br /&gt;
Templates and modules related to capitalization&lt;br /&gt;
{{Case templates see also}}&lt;br /&gt;
&lt;br /&gt;
Templates that implement &amp;lt;code&amp;gt;&amp;lt;no&amp;lt;!-- --&amp;gt;wiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* {{tl|nowiki}}&lt;br /&gt;
* {{tl|nowiki2}}&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>