<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_sub_new%2Fdoc</id>
	<title>Template:Str sub new/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_sub_new%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Template:Str_sub_new/doc&amp;action=history"/>
	<updated>2026-05-10T18:59:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Template:Str_sub_new/doc&amp;diff=40727&amp;oldid=prev</id>
		<title>imported&gt;GKFX: expand correct section of navbox</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Template:Str_sub_new/doc&amp;diff=40727&amp;oldid=prev"/>
		<updated>2021-11-20T10:15:48Z</updated>

		<summary type="html">&lt;p&gt;expand correct section of navbox&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;
{{lua|Module:String}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template selects a sub-string from the target string based on selected indices.  The indices are 1-based.  If the end index is omitted, it returns the rest of the string.  One can also specify negative indices, in which case the substr is selected by counting from the end of the string.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|target_string|start_index|end_index}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|s=target_string|i=start_index|j=end_index}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Unnamed parameters ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|1234567890|3|7}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{str sub new|1234567890|3|7}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|1234567890|3|-3}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{str sub new|1234567890|3|-3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|1234567890|3}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{str sub new|1234567890|3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|1234567890|12}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{str sub new|1234567890|12|nocategory=true}}&lt;br /&gt;
&lt;br /&gt;
=== Named parameters ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str sub new|s=abcd=fgh|i=3|j=7}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{Str sub new|s=abcd=fgh|i=3|j=7}}&lt;br /&gt;
&lt;br /&gt;
Equivalent to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:string|sub|s=abcd=fgh|i=3|j=7}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{#invoke:string|sub|s=abcd=fgh|i=3|j=7}}&lt;br /&gt;
&lt;br /&gt;
Named parameters are required if the target string contains an [[equals sign]], where unnamed or numbered parameters will not work as expected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|abcd=fgh|3|7}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{str sub new|abcd=fgh|3|7|nocategory=true}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{str sub new|1=abcd=fgh|2=3|3=7}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: {{str sub new|1=abcd=fgh|2=3|3=7}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{tl|Str sub old}}&lt;br /&gt;
&lt;br /&gt;
{{string-handling templates|sub}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:String manipulation templates]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;GKFX</name></author>
	</entry>
</feed>