<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://battleint.net/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://battleint.net/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_sub_new%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://battleint.net/index.php?title=Template:Str_sub_new/doc&amp;action=history"/>
	<updated>2026-12-05T19:39:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://battleint.net/index.php?title=Template:Str_sub_new/doc&amp;diff=170667&amp;oldid=prev</id>
		<title>imported&gt;Deadfire: Template Doc Creation</title>
		<link rel="alternate" type="text/html" href="https://battleint.net/index.php?title=Template:Str_sub_new/doc&amp;diff=170667&amp;oldid=prev"/>
		<updated>2023-07-18T01:18:46Z</updated>

		<summary type="html">&lt;p&gt;Template Doc Creation&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 [[w:equals sign|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;
{{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;Deadfire</name></author>
	</entry>
</feed>